验证是否登录
public function __construct()
{
$this->request = request();
// 验证是否登录
$this->middleware(function ($request, $next) {
if (sessino('user')) {
echo "<script>alert('请先登录!');location.href='" . url('admin/login') . "';</script>";
}
return $next($request);
});
}
网友评论