controller()); $action = lcfirst(request()->action()); $checkUrl = $control . '/' . $action; // if(!in_array($checkUrl , $this->noCheck)){ // if(empty(session('username')) || empty(session('id'))){ // //登录超时 // json(json_error_exception('1005'))->send(); // } // $this->cacheCheck(); // // 检测权限 // if(empty(authCheck($checkUrl))){ // json(json_error_exception('1000'))->send(); // } // } } private function cacheCheck() { $action = cache(session('role_id')); if(is_null($action) || empty($action)){ // 获取该管理员的角色信息 $roleModel = new RoleModel(); $info = $roleModel->getRoleInfo(session('role_id')); cache(session('role_id'), $info['action']); } } protected function removeRoleCache() { $roleModel = new RoleModel(); $roleList = $roleModel->getRole(); foreach ($roleList as $value) { cache($value['id'], null); } } }