diff --git a/ruoyi-common/ruoyi-common-tenant/src/main/java/com/ruoyi/common/tenant/helper/TenantHelper.java b/ruoyi-common/ruoyi-common-tenant/src/main/java/com/ruoyi/common/tenant/helper/TenantHelper.java index a436b603..0daf5d18 100644 --- a/ruoyi-common/ruoyi-common-tenant/src/main/java/com/ruoyi/common/tenant/helper/TenantHelper.java +++ b/ruoyi-common/ruoyi-common-tenant/src/main/java/com/ruoyi/common/tenant/helper/TenantHelper.java @@ -73,7 +73,7 @@ public class TenantHelper { if (!SpringMVCUtil.isWeb()) { return TEMP_DYNAMIC_TENANT.get(); } - String cacheKey = DYNAMIC_TENANT_KEY + ":" + LoginHelper.getTenantId(); + String cacheKey = DYNAMIC_TENANT_KEY + ":" + LoginHelper.getUserId(); String tenantId = (String) SaHolder.getStorage().get(cacheKey); if (StringUtils.isNotBlank(tenantId)) { return tenantId; diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/bo/SysUserBo.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/bo/SysUserBo.java index 94572fae..c2a3309a 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/bo/SysUserBo.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/bo/SysUserBo.java @@ -9,6 +9,7 @@ import com.ruoyi.system.domain.SysUser; import io.github.linpeilie.annotations.AutoMapper; import jakarta.validation.constraints.Email; import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.Size; import lombok.Data; import lombok.EqualsAndHashCode; @@ -110,6 +111,7 @@ public class SysUserBo extends BaseEntity { /** * 角色组 */ + @Size(min = 1, message = "用户角色不能为空") private Long[] roleIds; /**