|
@@ -16,8 +16,6 @@ class LoginService extends CrudService {
|
|
|
// 用户登录
|
|
|
async login(data) {
|
|
|
const { mobile, password } = data;
|
|
|
- console.log(mobile);
|
|
|
- console.log(password);
|
|
|
// 根据用户输入的手机号查询其他用户表中是否存在相应数据
|
|
|
let user = await this.model.findOne({ mobile });
|
|
|
const flag = true;
|
|
@@ -30,13 +28,13 @@ class LoginService extends CrudService {
|
|
|
}
|
|
|
let _user = '';
|
|
|
// 将用户输入的密码进行加密并与查询到的用户数据密码相比对
|
|
|
- const pasw = await this.createJwtPwd(password);
|
|
|
+ // const pasw = await this.createJwtPwd(password);
|
|
|
if (flag) {
|
|
|
// 手机
|
|
|
- _user = await this.model.findOne({ mobile, pasw });
|
|
|
+ _user = await this.model.findOne({ mobile, password });
|
|
|
} else {
|
|
|
// 手机
|
|
|
- _user = await this.model.findOne({ mobile, pasw });
|
|
|
+ _user = await this.model.findOne({ mobile, password });
|
|
|
}
|
|
|
if (_user === '') {
|
|
|
throw new BusinessError(ErrorCode.USER_NOT_EXIST);
|