$e->getMessage())); } } public function dcs_doorAction() { $rawArr = $this->getpostarr(); $groupArr = m("dcs_group")->getall("1=1 and is_show=1"); $rowArr = ["nav"=>[]]; $pcon = 0; for ($i = 0; $i < count($groupArr); $i++) { $row = $groupArr[$i]; if ($row['pid'] == 0) { $rowArr["nav"][$pcon] = [ "title"=>$row['name'], "list"=>[] ]; for ($j = 0; $j $crow['id'], "icon" => URL.(empty($crow['icon']) ? $row['icon'] : $crow['icon']), "module"=>$row['key'], "name"=>$crow['name'], "sys_code"=>$crow['key'], ]; } } $pcon++; } } return $rowArr; } public function dcs_auth_checkAction() { $staffNum = $this->get('staff_num'); $sys_id = $this->get('sys_id'); if (empty($staffNum) || empty($sys_id)) { $this->showreturn('', '参数错误!', 201); } $uInfo = m("admin")->getone("user='{$staffNum}'"); $checkAuth = m("dcs_auth")->getall("FIND_IN_SET($sys_id, `range`) and FIND_IN_SET({$uInfo['id']}, `user_ids`) "); // 找到权限 if (!empty($checkAuth) && count($checkAuth) > 0) { $urlInfo = m("dcs_group")->getone("id={$sys_id}"); $this->showreturn([url=>trim($urlInfo['url'])], '成功!', 200); } else { $this->showreturn('', '暂无权限访问,请联系管理员!', 202); } } }