登录:fix getsms返回

This commit is contained in:
luying
2021-03-04 15:57:43 +08:00
parent 62562c3482
commit 12d0395c63
2 changed files with 2 additions and 2 deletions

View File

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

View File

@@ -162,7 +162,7 @@ export default class Auth extends Service {
let user = await UserModel.findUserByTel(tel);
return this.ctx.service.utils.resResult(STATUS.SUCCESS, {
hasAccount: !!user && user.hasSetPw
hasAccount: !!user && !!user.hasSetPw
});
}