class LoginCheck
{
protected $arr=['addShow','showData'];
/**
* 处理请求
*
* @param \think\Request $request
* @param \Closure $next
* @return Response
*/
public function handle($request, \Closure $next)
{
$response=$next($request);
if(!in_array($request->pathinfo(),$this->arr)){
return redirect('loginShow');
}
return $response;
}
}
thinkphp6中间件鉴权
最新推荐文章于 2023-09-09 17:13:33 发布