pathinfo()); $response = $next($request); if($request->controller() !== 'Login' && $request->action() !=='logout') { //登陆检验 if (!Session::has('admin_id')) { return redirect('/admin/login/index'); } $app = app('http')->getName(); $controller = $request->controller(); $action = $request->action(); // 排除权限 $not_check = ['admin/Index/index','admin/Index/home','admin/Set/info','admin/Set/password','admin/User/logout']; if (!in_array($app . '/' . $controller . '/' . $action, $not_check)) { $auth = new UserAuth(); $admin_id = Session::get('admin_id'); if (!$auth->check($app . '/' . $controller . '/' . $action, $admin_id) && $admin_id != 1) { //return response(''); return response('没有权限'); } } } return $response; } }