[''], 'allow'=>[''] ]; Hook::listen('check_auth',$action); $request = Request::instance(); $a = strtolower($request->action()); if (!in_array($a, $action['permission'])) { parent::_initialize(); } } /** * 应用状态列表 * @author Michael_xu * @return */ public function index() { $configModel = model('Config'); $data = $configModel->getDataList(); return resultArray(['data' => $data]); } /** * 状态编辑 * @author Michael_xu * @return */ public function update() { $configModel = model('Config'); $param = $this->param; if (!$param['id']) { return resultArray(['error' => '参数错误']); } if ($configModel->updateDataById($param, $param['id'])) { return resultArray(['data' => '编辑成功']); } return resultArray(['error' => $configModel->getError()]); } }