2020-03-11 20:20:59 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace app\middleware;
|
|
|
|
use think\facade\Log;
|
|
|
|
|
|
|
|
class Browse
|
|
|
|
{
|
|
|
|
public function handle($request, \Closure $next)
|
|
|
|
{
|
2024-04-01 10:24:38 +08:00
|
|
|
$agent = $request->header('user-agent');
|
|
|
|
$ip = $request->ip();
|
|
|
|
$url = $request->url(true);
|
2020-03-11 20:20:59 +08:00
|
|
|
Log::channel('browse')->info('browse:{agent} {ip} {url}',['agent'=>$agent,'url'=>$url,'ip'=>$ip]);
|
2024-04-01 10:24:38 +08:00
|
|
|
|
|
|
|
return $next($request);
|
2020-03-11 20:20:59 +08:00
|
|
|
}
|
|
|
|
}
|