lrf402788946 4 anos atrás
pai
commit
5138230898
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      app/service/login.js

+ 2 - 2
app/service/login.js

@@ -19,13 +19,13 @@ class LoginService extends CrudService {
   async login(data) {
   async login(data) {
     const { phone, passwd, role } = data;
     const { phone, passwd, role } = data;
     // 根据用户输入的手机号查询其他用户表中是否存在相应数据
     // 根据用户输入的手机号查询其他用户表中是否存在相应数据
-    let user = await this.model.findOne({ phone, role });
+    let user = await this.model.findOne({ phone, role, isdel: '0' });
     // 增设使用code模式登陆的判断变量
     // 增设使用code模式登陆的判断变量
     let is_code = false;
     let is_code = false;
     // 如果用户不存在抛出异常
     // 如果用户不存在抛出异常
     if (!user) {
     if (!user) {
       // 添加code作为登录的方式
       // 添加code作为登录的方式
-      user = await this.model.findOne({ code: phone, role });
+      user = await this.model.findOne({ code: phone, role, isdel: '0' });
       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;
     }
     }
     const pdata = {};
     const pdata = {};