zhangweicheng 5 years ago
parent
commit
784e2a73f2
1 changed files with 1 additions and 1 deletions
  1. 1 1
      modules/users/models/log_model.js

+ 1 - 1
modules/users/models/log_model.js

@@ -60,7 +60,7 @@ class LogModel extends BaseModel {
      */
     async addLoginLog(userId, request) {
         let ip = request.connection.remoteAddress;
-        ip = ip.split(':');
+        ip = ip?ip.split(':'):[];
         ip = ip[3] === undefined ? '' : ip[3];
         // let ipInfo = '127.0.0.1';//await this.getIpInfoFromApi(ip);
         let ipInfo = await this.getIpInfoFromApi(ip);