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