update 优化 登录接口租户id被强制校验问题

feature/model
疯狂的狮子Li 1 year ago
parent eb9e4b5eef
commit 6381034b1f

@ -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.LoginType;
import org.dromara.common.core.enums.TenantStatus; import org.dromara.common.core.enums.TenantStatus;
import org.dromara.common.core.exception.user.UserException; import org.dromara.common.core.exception.user.UserException;
import org.dromara.common.core.utils.DateUtils; import org.dromara.common.core.utils.*;
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.log.event.LogininforEvent; import org.dromara.common.log.event.LogininforEvent;
import org.dromara.common.redis.utils.RedisUtils; import org.dromara.common.redis.utils.RedisUtils;
import org.dromara.common.satoken.utils.LoginHelper; import org.dromara.common.satoken.utils.LoginHelper;
@ -210,6 +207,9 @@ public class SysLoginService {
if (TenantConstants.DEFAULT_TENANT_ID.equals(tenantId)) { if (TenantConstants.DEFAULT_TENANT_ID.equals(tenantId)) {
return; return;
} }
if (StringUtils.isBlank(tenantId)) {
throw new TenantException("tenant.number.not.blank");
}
SysTenantVo tenant = tenantService.queryByTenantId(tenantId); SysTenantVo tenant = tenantService.queryByTenantId(tenantId);
if (ObjectUtil.isNull(tenant)) { if (ObjectUtil.isNull(tenant)) {
log.info("登录租户:{} 不存在.", tenantId); log.info("登录租户:{} 不存在.", tenantId);

@ -1,13 +1,12 @@
package org.dromara.common.core.domain.model; package org.dromara.common.core.domain.model;
import jakarta.validation.constraints.Email; import jakarta.validation.constraints.Email;
import org.dromara.common.core.constant.UserConstants; import jakarta.validation.constraints.NotBlank;
import lombok.Data; import lombok.Data;
import org.dromara.common.core.constant.UserConstants;
import org.dromara.common.core.validate.auth.*; import org.dromara.common.core.validate.auth.*;
import org.hibernate.validator.constraints.Length; import org.hibernate.validator.constraints.Length;
import jakarta.validation.constraints.NotBlank;
/** /**
* *
* *
@ -42,7 +41,6 @@ public class LoginBody {
/** /**
* ID * ID
*/ */
@NotBlank(message = "{tenant.number.not.blank}")
private String tenantId; private String tenantId;
/** /**

Loading…
Cancel
Save