| | |
| | | $this->route = $this->getRoute(); |
| | | //初始化redis |
| | | $this->redis = System_Service_Locator::getInstance()->get('redis'); |
| | | if(!$this->redis->exists('modules') ){ |
| | | $this->redis->set('modules', $this->getModules()); |
| | | } |
| | | //更新角色权限 |
| | | if(!$this->redis->exists('role_auth')){ |
| | | Util::updateRoleAuth(); |
| | | } |
| | | //是否渲染模板 |
| | | if(!empty($this->layout)){ |
| | | //根据角色权限访问 |
| | | //$this->modules = $this->modules_service->getModuleListByRoleId(); |
| | | $this->setLayout($this->layout); |
| | | } |
| | | |
| | | //将当前路由值传入模板 |
| | | $this->getView()->assign('route', $this->route); |
| | | } |
| | |
| | | return $this->getRequest()->isXmlHttpRequest(); |
| | | } |
| | | |
| | | /** |
| | | * 获取栏目列表 |
| | | * @return [type] [description] |
| | | */ |
| | | public function getModules(){ |
| | | $this->module_service = new Service_Module(); |
| | | return $this->module_service->getModuleList(array(), array(), array('level' => 1)); |
| | | } |
| | | |
| | | } |