lrf402788946 %!s(int64=4) %!d(string=hai) anos
pai
achega
00ef923f33
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      app/service/login.js

+ 2 - 2
app/service/login.js

@@ -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);
     }