Merge pull request #3763 from zxyle/dev

fix: 修复系统登录后密码被返回
This commit is contained in:
王嘉豪 2022-11-16 10:13:27 +08:00 committed by GitHub
commit 1c54cc5af6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -168,13 +168,14 @@ public class AuthServer implements AuthApi {
String token = ServletUtils.getToken();
Long userId = JWTUtils.tokenInfoByToken(token).getUserId();
SysUserEntity user = authUserService.getUserById(userId);
CurrentUserDto currentUserDto = BeanUtils.copyBean(new CurrentUserDto(), user);
CurrentUserDto currentUserDto = BeanUtils.copyBean(new CurrentUserDto(), user, "password");
List<CurrentRoleDto> currentRoleDtos = authUserService.roleInfos(user.getUserId());
List<String> permissions = authUserService.permissions(user.getUserId());
currentUserDto.setRoles(currentRoleDtos);
currentUserDto.setPermissions(permissions);
return currentUserDto;
}
userDto.setPassword(null);
return userDto;
}