refactor: 添加未认证和未授权自定义异常处理,printWriter无需手动关闭

This commit is contained in:
haoxr
2022-11-15 00:24:41 +08:00
parent 8c988de05a
commit dee6fa5cc4
7 changed files with 31 additions and 27 deletions

View File

@@ -211,11 +211,12 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
@Override
public UserAuthInfo getUserAuthInfo(String username) {
UserAuthInfo userAuthInfo = this.baseMapper.getUserAuthInfo(username);
Set<String> roles = userAuthInfo.getRoles();
if(CollectionUtil.isNotEmpty(roles)){
Set<String> perms= menuService.listRolePerms(roles);
userAuthInfo.setPerms(perms);
if(userAuthInfo!=null){
Set<String> roles = userAuthInfo.getRoles();
if(CollectionUtil.isNotEmpty(roles)){
Set<String> perms= menuService.listRolePerms(roles);
userAuthInfo.setPerms(perms);
}
}
return userAuthInfo;
}