|
@@ -24,9 +24,18 @@ class LoginService extends CrudService {
|
|
|
let is_code = false;
|
|
|
|
|
|
if (!user) {
|
|
|
-
|
|
|
- user = await this.model.findOne({ code: phone, role, institution_code });
|
|
|
- if (!user) { throw new BusinessError(ErrorCode.USER_NOT_EXIST); } else is_code = true;
|
|
|
+
|
|
|
+ if (role === '5') {
|
|
|
+ user = await this.model.findOne({ code: phone, role, institution_code });
|
|
|
+ } else {
|
|
|
+
|
|
|
+ user = await this.model.findOne({ code: phone, role });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (!user) {
|
|
|
+ throw new BusinessError(ErrorCode.USER_NOT_EXIST);
|
|
|
+ } else is_code = true;
|
|
|
}
|
|
|
const pdata = {};
|
|
|
if (is_code) pdata.code = phone;
|