From 6381034b1f5d63e28051303e6cfebb2b826956be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Tue, 12 Sep 2023 10:45:27 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E6=8E=A5=E5=8F=A3=E7=A7=9F=E6=88=B7id=E8=A2=AB?= =?UTF-8?q?=E5=BC=BA=E5=88=B6=E6=A0=A1=E9=AA=8C=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/dromara/web/service/SysLoginService.java | 8 ++++---- .../org/dromara/common/core/domain/model/LoginBody.java | 6 ++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/ruoyi-admin/src/main/java/org/dromara/web/service/SysLoginService.java b/ruoyi-admin/src/main/java/org/dromara/web/service/SysLoginService.java index 3a19f8c3..7e07e20f 100644 --- a/ruoyi-admin/src/main/java/org/dromara/web/service/SysLoginService.java +++ b/ruoyi-admin/src/main/java/org/dromara/web/service/SysLoginService.java @@ -15,10 +15,7 @@ import org.dromara.common.core.domain.model.LoginUser; import org.dromara.common.core.enums.LoginType; import org.dromara.common.core.enums.TenantStatus; import org.dromara.common.core.exception.user.UserException; -import org.dromara.common.core.utils.DateUtils; -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.*; import org.dromara.common.log.event.LogininforEvent; import org.dromara.common.redis.utils.RedisUtils; import org.dromara.common.satoken.utils.LoginHelper; @@ -210,6 +207,9 @@ public class SysLoginService { if (TenantConstants.DEFAULT_TENANT_ID.equals(tenantId)) { return; } + if (StringUtils.isBlank(tenantId)) { + throw new TenantException("tenant.number.not.blank"); + } SysTenantVo tenant = tenantService.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 cdff7738..71e49917 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 @@ -1,13 +1,12 @@ package org.dromara.common.core.domain.model; import jakarta.validation.constraints.Email; -import org.dromara.common.core.constant.UserConstants; +import jakarta.validation.constraints.NotBlank; import lombok.Data; +import org.dromara.common.core.constant.UserConstants; import org.dromara.common.core.validate.auth.*; import org.hibernate.validator.constraints.Length; -import jakarta.validation.constraints.NotBlank; - /** * 用户登录对象 * @@ -42,7 +41,6 @@ public class LoginBody { /** * 租户ID */ - @NotBlank(message = "{tenant.number.not.blank}") private String tenantId; /**