update 优化 三方登录不同域名获取不到租户id问题

This commit is contained in:
疯狂的狮子Li
2024-06-18 19:14:22 +08:00
parent 0b8fd7da3b
commit d28cdcd0e1
3 changed files with 23 additions and 8 deletions

View File

@@ -242,17 +242,17 @@ public class SysLoginService {
*
* @param tenantId 租户ID
*/
public void checkTenant(String tenantId) {
public RemoteTenantVo checkTenant(String tenantId) {
if (!TenantHelper.isEnable()) {
return;
}
if (TenantConstants.DEFAULT_TENANT_ID.equals(tenantId)) {
return;
return null;
}
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,5 +264,6 @@ public class SysLoginService {
log.info("登录租户:{} 已超过有效期.", tenantId);
throw new TenantException("tenant.expired");
}
return tenant;
}
}