fix: 用户权限从数据库读取

This commit is contained in:
hxr
2023-12-22 10:08:17 +08:00
parent da414475a2
commit 5981303b49

View File

@@ -258,16 +258,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
userInfoVO.setRoles(roles);
// 用户权限集合
Set<String> perms = new HashSet<>();
if (CollectionUtil.isNotEmpty(roles)) {
for (String role : roles) {
Set<String> rolePerms = (Set<String>) redisTemplate.opsForHash().get(CacheConstants.ROLE_PERMS_PREFIX, role);
if (CollectionUtil.isNotEmpty(rolePerms)) {
perms.addAll(rolePerms);
}
}
Set<String> perms = menuService.listRolePerms(roles);
userInfoVO.setPerms(perms);
}
userInfoVO.setPerms(perms);
return userInfoVO;
}