fix(应用): 修复应用登录后密码被返回

This commit is contained in:
Xiang Zheng 2022-11-15 20:26:33 +08:00
parent fc2469c45d
commit 7c84b6a68b
No known key found for this signature in database
GPG Key ID: 69F05529597FE668

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;
}