26 lines
442 B
PHP
Executable File
26 lines
442 B
PHP
Executable File
<?php
|
|
|
|
namespace app\middleware;
|
|
|
|
use Closure;
|
|
use think\Request;
|
|
|
|
/**
|
|
* 日志记录
|
|
*
|
|
* Class Log
|
|
* @package app\middleware
|
|
*/
|
|
class Log
|
|
{
|
|
public function handle(Request $request, Closure $next)
|
|
{
|
|
$response = $next($request);
|
|
|
|
// 添加中间件执行代码
|
|
\app\model\Log::write($request->controller(), $request->action(), $request->pathinfo(), $request->method());
|
|
|
|
return $response;
|
|
|
|
}
|
|
} |