From c379d6224e3be978cfb1bdb626b2a8b3a52014ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Sat, 16 Apr 2022 22:28:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/data/controller/base/Config.php | 87 +--------------- app/data/view/base/config/page_form.html | 36 ------- app/data/view/base/config/page_home.html | 25 ----- app/data/view/base/config/slider.html | 124 ----------------------- app/data/view/base/config/wxapp.html | 6 +- 5 files changed, 6 insertions(+), 272 deletions(-) delete mode 100644 app/data/view/base/config/page_form.html delete mode 100644 app/data/view/base/config/page_home.html delete mode 100644 app/data/view/base/config/slider.html 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'} -
-
- - - -
- 页面内容 - Page 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'} -
- {foreach $pageTypes as $key=>$type} -
- -
-
-
编辑页面内容
-
{$type|default=''}
-
- -
- -
-
编辑页面内容
-
{$type|default=''}
-
- - -
- {/foreach} -
-{/block} \ No newline at end of file diff --git a/app/data/view/base/config/slider.html b/app/data/view/base/config/slider.html deleted file mode 100644 index cb0597833..000000000 --- a/app/data/view/base/config/slider.html +++ /dev/null @@ -1,124 +0,0 @@ -{extend name="../../admin/view/main"} - -{block name="content"} -
-
-
- {$title|default='图片数据管理'} ( 建议上传图片尺寸为 690px 250px ) -
-
-
- -
-
-
- -
-
-
-
- -
-
-
- -
- - -
-
- - - - - - -{/block} \ No newline at end of file diff --git a/app/data/view/base/config/wxapp.html b/app/data/view/base/config/wxapp.html index a5b6f6b2e..408de5ef1 100644 --- a/app/data/view/base/config/wxapp.html +++ b/app/data/view/base/config/wxapp.html @@ -2,7 +2,7 @@ {block name="content"}
-
+
{$title|default='小程序接口配置'} ( 微信公众号平台配置获取 )
@@ -10,13 +10,13 @@