|
@@ -19,11 +19,11 @@ class LoginService extends CrudService {
|
|
|
}
|
|
|
|
|
|
async login(data) {
|
|
|
- const { mobile, passwd } = data;
|
|
|
+ const { mobile, passwd, type } = data;
|
|
|
assert(mobile, 'mobile不能为空');
|
|
|
// assert(/^\d{11}$/i.test(mobile), 'mobile无效');
|
|
|
assert(passwd, 'passwd不能为空');
|
|
|
- const res = await this.uModel.findOne({ mobile }, '+passwd');
|
|
|
+ const res = await this.uModel.findOne({ mobile, type }, '+passwd');
|
|
|
if (!res) {
|
|
|
throw new BusinessError(ErrorCode.USER_NOT_EXIST);
|
|
|
}
|