Browse Source

Update OplogService.php

Anyon 5 years ago
parent
commit
5491e3c043
1 changed files with 2 additions and 1 deletions
  1. 2 1
      application/admin/service/OplogService.php

+ 2 - 1
application/admin/service/OplogService.php

@@ -17,6 +17,7 @@ namespace app\admin\service;
 
 use library\tools\Node;
 use think\Db;
+use think\facade\Request;
 
 /**
  * 系统日志服务管理
@@ -35,7 +36,7 @@ class OplogService
     {
         return Db::name('SystemLog')->insert([
             'node'     => Node::current(), 'action' => $action, 'content' => $content,
-            'geoip'    => PHP_SAPI === 'cli' ? '127.0.0.1' : request()->ip(),
+            'geoip'    => PHP_SAPI === 'cli' ? '127.0.0.1' : Request::ip(),
             'username' => PHP_SAPI === 'cli' ? 'cli' : (string)session('admin_user.username'),
         ]);
     }