1234567891011121314151617181920212223242526272829303132 |
- <?php
- declare (strict_types = 1);
- namespace app\admin\middleware;
- use app\admin\model\SystemLog;
- class checkToken
- {
- /**
- * 处理请求
- *
- * @param \think\Request $request
- * @param \Closure $next
- * @return
- */
- public function handle($request, \Closure $next)
- {
- if ($request->isOptions()) {
- return json();
- }
- $data=[
- "info"=>"",
- "action"=>"",
- "url"=>$request->server()['REQUEST_URI'],
- "param"=>json_encode($request->param(),JSON_UNESCAPED_UNICODE),
- "name"=>'',
- "addtime"=>date("Y-m-d H:i:s")
- ];
- SystemLog::create($data);
- return $next($request);
- }
-
- }
|