测试:增加一个测试用接口;修改 config.json 中的默认环境

This commit is contained in:
liangtongchuan
2021-05-19 11:30:43 +08:00
parent 05b95bef87
commit de33a02525
3 changed files with 27 additions and 3 deletions

View File

@@ -182,8 +182,13 @@ export default class User extends BaseModel {
public static async findTokenByTel(tel: string) {
const { token } = await UserModel.findOne({ tel }).select('token').lean({ getters: true });
return token;
const user: UserType = await UserModel.findOne({ tel }).lean();
return user.token;
}
public static async findTokenByUid(uid: number) {
const user: UserType = await UserModel.findOne({ uid }).lean();
return user ? user.token : null;
}
public static async findUserByTel(tel: string) {