fix: 修复user.findById方法意外暴露了隐私字段的问题
This commit is contained in:
@@ -58,16 +58,7 @@ export class UserService {
|
||||
*/
|
||||
async findById(userId: string): Promise<UserPublicProfile | null> {
|
||||
return this.userRepository.findOne({
|
||||
select: {
|
||||
avatar: true,
|
||||
createdAt: true,
|
||||
email: true,
|
||||
nickname: true,
|
||||
username: true,
|
||||
phone: true,
|
||||
roles: true,
|
||||
userId: true,
|
||||
},
|
||||
select: ['userId', 'username', 'nickname', 'phone', 'email', 'avatar', 'roles', 'createdAt'],
|
||||
where: {
|
||||
userId,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user