diff --git a/app/data/controller/base/Config.php b/app/data/controller/base/Config.php index 8d72e9c6e..42f4e6580 100644 --- a/app/data/controller/base/Config.php +++ b/app/data/controller/base/Config.php @@ -11,14 +11,6 @@ use think\admin\Controller; */ class Config extends Controller { - /** - * 页面类型 - * @var array - */ - protected $pageTypes = [ - '关于我们' => '关于我们', - '用户协议' => '用户协议', - ]; /** * 微信小程序配置 @@ -30,8 +22,9 @@ class Config extends Controller */ public function wxapp() { + $this->skey = 'wxapp'; $this->title = '微信小程序配置'; - $this->__sysconf('wxapp'); + $this->__sysdata('wxapp'); } /** @@ -44,85 +37,11 @@ class Config extends Controller */ public function cropper() { - $this->title = '邀请二维码设置'; $this->skey = 'cropper'; + $this->title = '邀请二维码设置'; $this->__sysdata('cropper'); } - /** - * 内容页面管理 - * @auth true - * @menu true - */ - public function pageHome() - { - $this->title = '内容页面管理'; - $this->fetch('page_home'); - } - - /** - * 内容页面编辑 - * @auth true - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException - */ - public function pageEdit() - { - $this->skey = input('type') ?: $this->pageTypes[0]; - $this->title = '编辑' . $this->pageTypes[$this->skey] ?? ''; - $this->__sysdata('page_form', 'javascript:history.back()'); - } - - /** - * 首页推荐位管理 - * @menu true - * @auth true - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException - */ - public function iconHome() - { - $this->skey = 'IconHome'; - $this->title = '首页推荐位管理'; - $this->__sysdata('slider'); - } - - /** - * 首页轮播图片 - * @menu true - * @auth true - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException - */ - public function sliderHome() - { - $this->skey = 'SliderHome'; - $this->title = '首页轮播图片'; - $this->__sysdata('slider'); - } - - /** - * 显示并保存配置 - * @param string $template 模板文件名称 - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\DbException - * @throws \think\db\exception\ModelNotFoundException - */ - private function __sysconf(string $template) - { - if ($this->request->isGet()) { - $this->fetch($template); - } - if ($this->request->isPost()) { - $data = $this->request->post(); - foreach ($data as $k => $v) sysconf($k, $v); - $this->success('配置保存成功!'); - } - } - /** * 显示并保存数据 * @param string $template 模板文件 diff --git a/app/data/view/base/config/page_form.html b/app/data/view/base/config/page_form.html deleted file mode 100644 index 05814efa4..000000000 --- a/app/data/view/base/config/page_form.html +++ /dev/null @@ -1,36 +0,0 @@ -{extend name="../../admin/view/main"} - -{block name='content'} -
- - -{/block} \ No newline at end of file diff --git a/app/data/view/base/config/page_home.html b/app/data/view/base/config/page_home.html deleted file mode 100644 index 1151fe2c5..000000000 --- a/app/data/view/base/config/page_home.html +++ /dev/null @@ -1,25 +0,0 @@ -{extend name="../../admin/view/main"} - -{block name='content'} -