浏览代码

Merge branch 'master' of http://git.cc-lotus.info/service-platform/service-auth

lrf402788946 5 年之前
父节点
当前提交
3889e45e98
共有 1 个文件被更改,包括 13 次插入0 次删除
  1. 13 0
      app/service/login.js

+ 13 - 0
app/service/login.js

@@ -31,6 +31,19 @@ class LoginService extends CrudService {
     if (pas !== _user.passwd.secret) {
       throw new BusinessError(ErrorCode.BAD_PASSWORD);
     }
+    if (_user.role === '2' || _user.role === '3') {
+      const url = 'http://127.0.0.1:9004/api/market/user/' + _user.uid;
+      const marketuser = await this.ctx.curl(url, {
+        method: 'get',
+        headers: {
+          'content-type': 'application/json',
+        },
+        dataType: 'json',
+      });
+      if (marketuser.data.data.status !== '1') {
+        throw new BusinessError(ErrorCode.ACCESS_DENIED);
+      }
+    }
     // 取出用户的类型,根据用户类型返回相应信息
     const state = uuid();
     const key = `free:auth:state:${state}`;