request->isPost()) { $data = input("post."); if(isset($data['_token'])) { unset($data['_token']); } ConfigSetting::setConfigByName($configName, $data); return $this->json(0); } else { // 兼容写法,把原配置文件中的配置信息写入到数据库 $conf = ConfigSetting::getConfigContentsByName($configName); if (empty($conf)) { CConfig::load('extra/base', $configName); $conf = config($configName); if (!empty($conf)) { ConfigSetting::setConfigByName($configName, $conf); } } $this->data['item'] = $conf; return $this->view(); } } //法律制度 public function statute() { $configName = 'extraStatute'; if ($this->request->isPost()) { $data = input("post."); if(isset($data['_token'])) { unset($data['_token']); } ConfigSetting::setConfigByName($configName, $data); return $this->json(); } else { $conf = ConfigSetting::getConfigContentsByName($configName); if (empty($conf)) { CConfig::load('extra/statute', $configName); $conf = config($configName); if (!empty($conf)) { ConfigSetting::setConfigByName($configName, $conf); } } $this->data['item'] = $conf; return $this->view(); } } /** * 侧边栏配置 * @date 2021-11 */ public function slide() { $configName = 'extraSlide'; if ($this->request->isPost()) { $data = input("post."); if(isset($data['_token'])) { unset($data['_token']); } ConfigSetting::setConfigByName($configName, $data); return $this->json(); } else { $conf = ConfigSetting::getConfigContentsByName($configName); $this->data['item'] = $conf; return $this->view(); } } }