!307 修复动态租户切换影响同租户下其他用户问题,增加用户新增角色必填后端验证

Merge pull request !307 from Yjoioooo/5.X
feature/model
疯狂的狮子Li 2 years ago committed by Gitee
commit 169e2e9ae9
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

@ -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;

@ -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;
/**

Loading…
Cancel
Save