feat: 开发持仓、股票信息相关接口
This commit is contained in:
@@ -193,11 +193,18 @@ export class UserService {
|
||||
take: limit,
|
||||
});
|
||||
|
||||
// 移除 passwordHash 字段
|
||||
const listWithoutPassword = list.map((user) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const { passwordHash, ...userWithoutPassword } = user;
|
||||
return userWithoutPassword as User;
|
||||
});
|
||||
|
||||
// 计算总页数
|
||||
const total_page = Math.ceil(total / limit);
|
||||
|
||||
return {
|
||||
list,
|
||||
list: listWithoutPassword,
|
||||
pagination: {
|
||||
total,
|
||||
total_page,
|
||||
@@ -247,7 +254,10 @@ export class UserService {
|
||||
throw new NotFoundException(`未找到ID为 ${id} 的用户`);
|
||||
}
|
||||
|
||||
return user;
|
||||
// 移除 passwordHash 字段
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const { passwordHash, ...userWithoutPassword } = user;
|
||||
return userWithoutPassword as User;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user