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 1631a914..f9edd349 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 @@ -21,6 +21,7 @@ import org.dromara.common.core.exception.user.UserException; import org.dromara.common.core.utils.MessageUtils; import org.dromara.common.core.utils.ServletUtils; import org.dromara.common.core.utils.SpringUtils; +import org.dromara.common.core.utils.StringUtils; import org.dromara.common.log.event.LogininforEvent; import org.dromara.common.redis.utils.RedisUtils; import org.dromara.common.satoken.utils.LoginHelper; @@ -198,6 +199,9 @@ public class SysLoginService { 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 (ObjectUtil.isNull(tenant)) { log.info("登录租户:{} 不存在.", tenantId); diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/model/LoginBody.java b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/model/LoginBody.java index 33d092dc..4f0283b7 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/model/LoginBody.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/domain/model/LoginBody.java @@ -43,7 +43,6 @@ public class LoginBody { /** * 租户ID */ - @NotBlank(message = "{tenant.number.not.blank}") private String tenantId; /**