|
@@ -25,15 +25,13 @@ class LoginService extends CrudService {
|
|
// 如果用户不存在抛出异常
|
|
// 如果用户不存在抛出异常
|
|
if (!user) {
|
|
if (!user) {
|
|
// 添加code作为登录的方式
|
|
// 添加code作为登录的方式
|
|
- console.log(role);
|
|
|
|
|
|
+ console.error(role);
|
|
if (role === '5') {
|
|
if (role === '5') {
|
|
|
|
+ console.error('function in');
|
|
user = await this.model.findOne({ institution_code: phone, role });
|
|
user = await this.model.findOne({ institution_code: phone, role });
|
|
} else { user = await this.model.findOne({ code: phone, role }); }
|
|
} else { user = await this.model.findOne({ code: phone, role }); }
|
|
if (!user) { throw new BusinessError(ErrorCode.USER_NOT_EXIST); } else is_code = true;
|
|
if (!user) { throw new BusinessError(ErrorCode.USER_NOT_EXIST); } else is_code = true;
|
|
}
|
|
}
|
|
- console.group('user');
|
|
|
|
- console.log(`${JSON.stringify(user)}`);
|
|
|
|
- console.groupEnd();
|
|
|
|
const pdata = {};
|
|
const pdata = {};
|
|
if (is_code) pdata.code = phone;
|
|
if (is_code) pdata.code = phone;
|
|
else pdata.phone = phone;
|
|
else pdata.phone = phone;
|