Selaa lähdekoodia

test: 测试登录日志记录

lanjianrong 4 vuotta sitten
vanhempi
commit
f55703b670
2 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 1 1
      app/service/login_logging.js
  2. 1 1
      app/service/project_account.js

+ 1 - 1
app/service/login_logging.js

@@ -61,7 +61,7 @@ module.exports = app => {
          */
         async getIpInfoFromApi(a_ip = '') {
             if (!a_ip) return '';
-            if (a_ip === '127.0.0.1') return '服务器本机访问';
+            if (a_ip === '127.0.0.1' || a_ip === '::1') return '服务器本机访问';
             const { ip = '', region = '', city = '', isp = '' } = await this.sendRequest(a_ip);
             let address = '';
             region && (address += region + '省');

+ 1 - 1
app/service/project_account.js

@@ -245,7 +245,7 @@ module.exports = app => {
                     this.ctx.session.sessionProjectList = projectList;
                     if (loginStatus === loginWay.normalPsw) {
                         // 正常登录-记录登录日志
-                        // await this.ctx.service.loginLogging.addLoginLog();
+                        await this.ctx.service.loginLogging.addLoginLog();
                     }
 
                 }