测试:添加测试用的 token 查询接口,不再写死 token

This commit is contained in:
liangtongchuan
2021-02-08 10:54:19 +08:00
parent d889d1b7a4
commit 321e082a2e
5 changed files with 57 additions and 18 deletions

View File

@@ -87,6 +87,11 @@ export default class User extends BaseModel {
return user;
}
public static async findTokenByTel(tel: string, lean = true) {
const { token } = await UserModel.findOne({ tel }).select('token').lean(lean);
return token;
}
public static async findUserByTel(tel: string, lean = true) {
const user: UserType = await UserModel.findOne({ tel }).select('uid tel').lean(lean);
return user;