lrf402788946 4 years ago
parent
commit
c4a2d6c1d9
1 changed files with 2 additions and 2 deletions
  1. 2 2
      app/service/login.js

+ 2 - 2
app/service/login.js

@@ -17,7 +17,7 @@ class LoginService extends CrudService {
 
   // 用户登录
   async login(data) {
-    const { phone, passwd, role } = data;
+    const { phone, passwd, role, institution_code } = data;
     // 根据用户输入的手机号查询其他用户表中是否存在相应数据
     let user = await this.model.findOne({ phone, role });
     // 增设使用code模式登陆的判断变量
@@ -25,7 +25,7 @@ class LoginService extends CrudService {
     // 如果用户不存在抛出异常
     if (!user) {
       // 添加code作为登录的方式
-      user = await this.model.findOne({ code: phone, role });
+      user = await this.model.findOne({ code: phone, role, institution_code });
       if (!user) { throw new BusinessError(ErrorCode.USER_NOT_EXIST); } else is_code = true;
     }
     const pdata = {};