refactor: 移除用户认证信息的 perms 字段(接口鉴权根据全局角色权限规则的缓存和用户角色校验)

This commit is contained in:
Ray.Hao
2024-12-06 17:31:21 +08:00
parent e9afa3f817
commit c56d417dbe
3 changed files with 0 additions and 18 deletions

View File

@@ -202,11 +202,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
UserAuthInfo userAuthInfo = this.baseMapper.getUserAuthInfo(username);
if (userAuthInfo != null) {
Set<String> roles = userAuthInfo.getRoles();
if (CollectionUtil.isNotEmpty(roles)) {
Set<String> perms = roleMenuService.getRolePermsByRoleCodes(roles);
userAuthInfo.setPerms(perms);
}
// 获取最大范围的数据权限
Integer dataScope = roleService.getMaximumDataScope(roles);
userAuthInfo.setDataScope(dataScope);
@@ -226,11 +221,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
UserAuthInfo userAuthInfo = this.baseMapper.getUserAuthInfoByOpenId(openid);
if (userAuthInfo != null) {
Set<String> roles = userAuthInfo.getRoles();
if (CollectionUtil.isNotEmpty(roles)) {
Set<String> perms = roleMenuService.getRolePermsByRoleCodes(roles);
userAuthInfo.setPerms(perms);
}
// 获取最大范围的数据权限
Integer dataScope = roleService.getMaximumDataScope(roles);
userAuthInfo.setDataScope(dataScope);