cheny 4 years ago
parent
commit
7aa0635a5c
1 changed files with 13 additions and 13 deletions
  1. 13 13
      app/service/login.js

+ 13 - 13
app/service/login.js

@@ -84,19 +84,19 @@ class LoginService extends CrudService {
     const token = await this.createJwt(user);
     await this.app.redis.set(key, token, 'EX', 60 * 60 * 24);
 
-    // const operationlogdata = { login_id: user.id, login_name: user.name, login_role: user.role, type: '0', operation_edit: '登录' };
-    // const url = 'http://127.0.0.1:9004/api/market/operationlog/';
-    // const operationlog = await this.ctx.curl(url, {
-    //   method: 'post',
-    //   headers: {
-    //     'content-type': 'application/json',
-    //   },
-    //   dataType: 'json',
-    //   data: JSON.stringify(operationlogdata),
-    // });
-    // if (operationlog.data.errcode === 0) {
-    //   console.log('1234');
-    // }
+    const operationlogdata = { login_id: user.id, login_name: user.name, login_role: user.role, type: '0', operation_edit: '登录' };
+    const url = 'http://127.0.0.1:9004/api/market/operationlog/';
+    const operationlog = await this.ctx.curl(url, {
+      method: 'post',
+      headers: {
+        'content-type': 'application/json',
+      },
+      dataType: 'json',
+      data: JSON.stringify(operationlogdata),
+    });
+    if (operationlog.data.errcode === 0) {
+      console.log('1234');
+    }
     return { key };
   }