diff --git a/ruoyi-auth/src/main/java/org/dromara/auth/controller/TokenController.java b/ruoyi-auth/src/main/java/org/dromara/auth/controller/TokenController.java index 40ce650e..f4ae3941 100644 --- a/ruoyi-auth/src/main/java/org/dromara/auth/controller/TokenController.java +++ b/ruoyi-auth/src/main/java/org/dromara/auth/controller/TokenController.java @@ -91,12 +91,9 @@ public class TokenController { return R.fail(MessageUtils.message("auth.grant.type.blocked")); } // 校验租户 - RemoteTenantVo tenant = sysLoginService.checkTenant(loginBody.getTenantId()); + sysLoginService.checkTenant(loginBody.getTenantId()); // 登录 LoginVo loginVo = IAuthStrategy.login(body, clientVo, grantType); - if (StringUtils.isNotBlank(tenant.getTenantId())) { - loginVo.setDomain(tenant.getDomain()); - } Long userId = LoginHelper.getUserId(); scheduledExecutorService.schedule(() -> { @@ -129,7 +126,7 @@ public class TokenController { * @return 结果 */ @PostMapping("/social/callback") - public R socialCallback(@RequestBody SocialLoginBody loginBody) { + public R socialCallback(@RequestBody SocialLoginBody loginBody) { // 获取第三方登录信息 AuthResponse response = SocialUtils.loginAuth( loginBody.getSource(), loginBody.getSocialCode(), @@ -140,13 +137,7 @@ public class TokenController { return R.fail(response.getMsg()); } sysLoginService.socialRegister(authUserData); - - LoginVo loginVo = new LoginVo(); - RemoteTenantVo tenant = sysLoginService.checkTenant(LoginHelper.getTenantId()); - if (StringUtils.isNotBlank(tenant.getTenantId())) { - loginVo.setDomain(tenant.getDomain()); - } - return R.ok(loginVo); + return R.ok(); } diff --git a/ruoyi-auth/src/main/java/org/dromara/auth/domain/vo/LoginVo.java b/ruoyi-auth/src/main/java/org/dromara/auth/domain/vo/LoginVo.java index 12e580af..e4bea143 100644 --- a/ruoyi-auth/src/main/java/org/dromara/auth/domain/vo/LoginVo.java +++ b/ruoyi-auth/src/main/java/org/dromara/auth/domain/vo/LoginVo.java @@ -51,9 +51,4 @@ public class LoginVo { */ private String openid; - /** - * 域名 - */ - private String domain; - } diff --git a/ruoyi-auth/src/main/java/org/dromara/auth/service/SysLoginService.java b/ruoyi-auth/src/main/java/org/dromara/auth/service/SysLoginService.java index dff38c83..eacdc01b 100644 --- a/ruoyi-auth/src/main/java/org/dromara/auth/service/SysLoginService.java +++ b/ruoyi-auth/src/main/java/org/dromara/auth/service/SysLoginService.java @@ -242,17 +242,17 @@ public class SysLoginService { * * @param tenantId 租户ID */ - public RemoteTenantVo checkTenant(String tenantId) { + public void checkTenant(String tenantId) { if (!TenantHelper.isEnable()) { - return null; + return; + } + if (TenantConstants.DEFAULT_TENANT_ID.equals(tenantId)) { + return; } if (StringUtils.isBlank(tenantId)) { throw new TenantException("tenant.number.not.blank"); } RemoteTenantVo tenant = remoteTenantService.queryByTenantId(tenantId); - if (TenantConstants.DEFAULT_TENANT_ID.equals(tenantId)) { - return tenant; - } if (ObjectUtil.isNull(tenant)) { log.info("登录租户:{} 不存在.", tenantId); throw new TenantException("tenant.not.exists"); @@ -264,6 +264,5 @@ public class SysLoginService { log.info("登录租户:{} 已超过有效期.", tenantId); throw new TenantException("tenant.expired"); } - return tenant; } }