fix: 用户权限从数据库读取
This commit is contained in:
@@ -258,16 +258,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||||||
userInfoVO.setRoles(roles);
|
userInfoVO.setRoles(roles);
|
||||||
|
|
||||||
// 用户权限集合
|
// 用户权限集合
|
||||||
Set<String> perms = new HashSet<>();
|
|
||||||
if (CollectionUtil.isNotEmpty(roles)) {
|
if (CollectionUtil.isNotEmpty(roles)) {
|
||||||
for (String role : roles) {
|
Set<String> perms = menuService.listRolePerms(roles);
|
||||||
Set<String> rolePerms = (Set<String>) redisTemplate.opsForHash().get(CacheConstants.ROLE_PERMS_PREFIX, role);
|
userInfoVO.setPerms(perms);
|
||||||
if (CollectionUtil.isNotEmpty(rolePerms)) {
|
|
||||||
perms.addAll(rolePerms);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
userInfoVO.setPerms(perms);
|
|
||||||
return userInfoVO;
|
return userInfoVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user