Authconfig = [ "admin/field.field/add", // 财政局属性设置 "admin/field.fieldcompany/add", // 公司属性设置 "admin/field.fieldproprietor/add", // 业主属性设置 "admin/project.cost_company/get_yezhu_tree", // 获取业主 "admin/project.cost_company/get_employee", // 获取雇主 "admin/api/upload", // 上传文件 "admin/project.cost/getemployeelist", // 获取单位 "admin/project.cost_company/get_department_tree", // 获取部门 "admin/project.cost/get_customer_head", // 委托单位负责人 "admin/project.cost/get_customer", // 选择委托单位 // "admin/project.api/add_file", // 上传附件 // "admin/project.api/delete_file", // 删除附件 "admin/message/index", // 消息中心 "admin/message/read", //消息中心的已读 "admin/project.api/eliminate",//小红点消息消除 "admin/project.api/add_file", "admin/project.received/get_department_tree", "admin/project.received/get_employee", "admin/index/people",//公司 "admin/project.api/get_department_tree",//获取人 "admin/project.api/get_employee", "admin/project.api/get_all_people_company", "admin/project.api/get_all_people", "admin/project.api/test", //zjl的测试方法 "admin/project.api/get_project", "admin/project.appropriation/edit_company", "admin/project.appropriation/c_edit", // "admin/project.audit/read_company", // "admin/project.appropriation/c_read", "admin/project.comment/add_company", "admin/project.comment/add", "admin/project.comment/add_proprietor", "admin/project.api/get_entrust", "admin/project.api/get_entrust_people", "admin/contract.api/check_node", "admin/contract.api/relevancy_p", "admin/project.api/get_self_project", "admin/contract.api/get_contract", "admin/project.api/get_sent_review", "admin/project.api/get_sent_review_people", "admin/datastat.datastat/test" ]; } public function handle($request, \Closure $next) { //获取模块名称 $controller = app('http')->getName(); $pathInfo = str_replace('' . $request->ext(), '', $request->pathInfo()); // dump($pathInfo); $action = explode('/', $pathInfo)[0]; //var_dump($pathInfo);exit; if ($pathInfo == '' || $action == '') { redirect('/admin/index/index.html')->send(); exit; } //验证用户登录 if ($action !== 'login') { $session_admin = get_config('app.session_admin'); if (!Session::has($session_admin)) { if ($request->isAjax()) { return to_assign(404, '请先登录'); } else { redirect('/admin/login/index.html')->send(); exit; } } $uid = Session::get($session_admin)['id']; //验证用户访问权限 // if ($action !== 'index' && $action !== 'api') { // if (!$this->checkAuth($controller, $pathInfo, $action, $uid)) { // if ($request->isAjax()) { // return to_assign(202, '没有使用权限!'); // } else { // echo '