mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-06 10:02:49 +08:00
完成内置的数据库日志驱动;内置数据库日志的定时清除;更新新的数据库sql;
This commit is contained in:
@@ -12,7 +12,6 @@
|
||||
|
||||
namespace app\admin\middleware;
|
||||
|
||||
use app\admin\service\SystemLogService;
|
||||
use app\Request;
|
||||
use EasyAdmin\tool\CommonTool;
|
||||
use think\facade\Log;
|
||||
@@ -48,14 +47,6 @@ class SystemLog
|
||||
$method = strtolower($request->method());
|
||||
$url = $request->url();
|
||||
|
||||
trace([
|
||||
'url' => $url,
|
||||
'method' => $method,
|
||||
'params' => $params,
|
||||
],
|
||||
'requestDebugInfo'
|
||||
);
|
||||
|
||||
if ($request->isAjax()) {
|
||||
if (in_array($method, ['post', 'put', 'delete'])) {
|
||||
$ip = CommonTool::getRealIp();
|
||||
@@ -68,10 +59,9 @@ class SystemLog
|
||||
'useragent' => $_SERVER['HTTP_USER_AGENT'],
|
||||
'create_time' => time(),
|
||||
];
|
||||
SystemLogService::instance()->save($data);
|
||||
Log::debug($data);
|
||||
}
|
||||
}
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user