|
@@ -3,7 +3,8 @@ declare (strict_types = 1);
|
|
|
|
|
|
namespace app\middleware;
|
|
|
|
|
|
-use app\cxinv\model\SystemLog;use think\facade\Log;class HttpLog
|
|
|
+use think\facade\Log;
|
|
|
+class HttpLog
|
|
|
{
|
|
|
/**
|
|
|
* 处理请求
|
|
@@ -18,11 +19,10 @@ use app\cxinv\model\SystemLog;use think\facade\Log;class HttpLog
|
|
|
error('OPTIONS请求');
|
|
|
}
|
|
|
$data=[
|
|
|
- 'info'=>$request->module(),
|
|
|
- 'action'=>$request->controller(),
|
|
|
- 'url'=>$request->action(),
|
|
|
- 'param'=>json_encode($request->param(),JSON_UNESCAPED_UNICODE),
|
|
|
- 'name'=>'',
|
|
|
+ 'url'=>array_values(array_filter(explode('/',$request->url()))),
|
|
|
+ 'method'=>$request->method(),
|
|
|
+ 'ip'=>$request->ip(),
|
|
|
+ 'param'=>$request->param(),
|
|
|
'addtime'=>date('Y-m-d H:i:s')
|
|
|
];
|
|
|
Log::info(json_encode($data,JSON_UNESCAPED_UNICODE));
|