diff --git a/application/admin/controller/Config.php b/application/admin/controller/Config.php index 65a690d1c..d15f5e534 100644 --- a/application/admin/controller/Config.php +++ b/application/admin/controller/Config.php @@ -17,6 +17,7 @@ namespace app\admin\controller; use library\Controller; use think\exception\HttpResponseException; +use think\facade\Request; /** * 系统参数配置 @@ -61,24 +62,35 @@ class Config extends Controller * 系统参数配置 * @auth true * @menu true + * @throws \think\Exception + * @throws \think\exception\PDOException */ public function info() { - $this->title = '系统参数配置'; - $this->applyCsrfToken('save'); - $this->fetch(); + $this->applyCsrfToken(); + if (Request::isGet()) { + $this->title = '系统参数配置'; + $this->fetch(); + } + $post = $this->request->post(); + foreach ($post as $key => $value) sysconf($key, $value); + $this->success('系统参数配置成功!'); } /** - * 保存参数到服务器 + * 文件存储引擎 * @auth true * @throws \think\Exception * @throws \think\exception\PDOException */ - public function save() + public function file() { - $this->applyCsrfToken('save'); - $post = $this->request->post(); + $this->applyCsrfToken(); + if (Request::isGet()) { + $this->type = input('type', 'local'); + $this->fetch("storage-{$this->type}"); + } + $post = Request::post(); if (isset($post['storage_type']) && isset($post['storage_local_exts'])) { $exts = array_unique(explode(',', strtolower($post['storage_local_exts']))); sort($exts); @@ -101,7 +113,7 @@ class Config extends Controller $this->error("阿里云OSS存储配置失效,{$e->getMessage()}"); } } else { - $this->success('参数配置成功!'); + $this->success('文件存储配置成功!'); } } diff --git a/application/admin/view/config/info-storage.html b/application/admin/view/config/info-storage.html deleted file mode 100644 index 98f5f5092..000000000 --- a/application/admin/view/config/info-storage.html +++ /dev/null @@ -1,32 +0,0 @@ -
-
-
- -
- {foreach ['local'=>'本地服务器存储','qiniu'=>'七牛云对象存储','oss'=>'阿里云OSS存储'] as $k=>$v} - - {/foreach} -

请选择文件存储类型,其它云储存需要配置正确的参数才可以上传文件哦!

-
-
-
-
- -
-
{include file='config/info-storage-oss'}
-
{include file='config/info-storage-local'}
-
{include file='config/info-storage-qiniu'}
-
- - diff --git a/application/admin/view/config/info-website.html b/application/admin/view/config/info-website.html deleted file mode 100644 index d7c1607e9..000000000 --- a/application/admin/view/config/info-website.html +++ /dev/null @@ -1,54 +0,0 @@ -
-
-
-
- -
- -

当前程序名称,在后台主标题上显示 {:sysconf('app_name')}

-
-
-
- -
- -

当前程序版本号,在后台主标题上标显示版本 {:sysconf('app_version')}

-
-
-
- -
- -

网站名称,将在浏览器的标签上显示 {:sysconf('site_name')}

-
-
-
- -
- icon - - 上传图片 -

建议上传 ICO 图标的尺寸为 128x128px,此图标用于网站标题前,ICON在线制作

-
-
-
- -
- -

程序的版权信息设置,在后台登录页面显示版本信息

-
-
-
- -
- -

网站备案号,可以在备案管理中心查询获取,将在登录页面下面显示

-
-
-
-
- -
-
-
-
\ No newline at end of file diff --git a/application/admin/view/config/info.html b/application/admin/view/config/info.html index d58095d67..a27de148d 100644 --- a/application/admin/view/config/info.html +++ b/application/admin/view/config/info.html @@ -1,29 +1,72 @@ {extend name="main"} {block name="content"} +
-
- -
-
{include file='config/info-website'}
-
{include file='config/info-storage'}
+
+ 文件存储引擎: + {foreach ['local'=>'本地服务器存储','qiniu'=>'七牛云对象存储','oss'=>'阿里云OSS存储'] as $k=>$v} + {if sysconf('storage_type') eq $k} + {if auth('file')}{$v}{else}{$v}{/if} + {elseif auth('file')}{$v}{/if} + {/foreach}
+ +
+
+ +

当前程序名称,在后台主标题上显示 {:sysconf('app_name')}

+
+
+ +

当前程序版本号,在后台主标题上标显示版本 {:sysconf('app_version')}

+
+
+ +

网站名称,将在浏览器的标签上显示 {:sysconf('site_name')}

+
+
+ 浏览器图标 + Browser +
+ icon + + 上传图片 +

建议上传 ICO 图标的尺寸为 128x128,ICON在线制作

+
+
+
+ +

程序的版权信息设置,在后台登录页面显示版本信息

+
+
+ +

网站备案号,可以在备案管理中心查询获取,将在登录页面下面显示

+
+
+
+ +
+
- - - {/block} \ No newline at end of file diff --git a/application/admin/view/config/info-storage-local.html b/application/admin/view/config/storage-local.html similarity index 81% rename from application/admin/view/config/info-storage-local.html rename to application/admin/view/config/storage-local.html index 112c933c4..6c45e28de 100644 --- a/application/admin/view/config/info-storage-local.html +++ b/application/admin/view/config/storage-local.html @@ -1,4 +1,4 @@ -
+
@@ -15,6 +15,7 @@
+
diff --git a/application/admin/view/config/info-storage-oss.html b/application/admin/view/config/storage-oss.html similarity index 93% rename from application/admin/view/config/info-storage-oss.html rename to application/admin/view/config/storage-oss.html index f849fd4e0..ffc116975 100644 --- a/application/admin/view/config/info-storage-oss.html +++ b/application/admin/view/config/storage-oss.html @@ -1,8 +1,8 @@ - +
- 文件将上传到阿里云OSS空间,需要配置OSS公开访问及跨域策略(目前已实现自动创建空间及配置访问策略)。 + 文件将上传到阿里云OSS空间,需要配置OSS公开访问及跨域策略(目前已实现自动创建空间及配置访问策略)!
@@ -73,7 +73,9 @@
+
- \ No newline at end of file + + diff --git a/application/admin/view/config/info-storage-qiniu.html b/application/admin/view/config/storage-qiniu.html similarity index 94% rename from application/admin/view/config/info-storage-qiniu.html rename to application/admin/view/config/storage-qiniu.html index 2393b5545..cca3b933e 100644 --- a/application/admin/view/config/info-storage-qiniu.html +++ b/application/admin/view/config/storage-qiniu.html @@ -1,8 +1,8 @@ -
+
- 文件将上传到七牛云空间(点击这里免费申请10G存储),申请成功后添加公开bucket并配置接口密钥。 + 文件将上传到七牛云空间(点击这里免费申请10G存储),申请成功后添加公开bucket并配置接口密钥!
@@ -74,7 +74,8 @@
+
- + \ No newline at end of file diff --git a/application/service/view/config/index.html b/application/service/view/config/index.html index de1b33e21..8980a368d 100644 --- a/application/service/view/config/index.html +++ b/application/service/view/config/index.html @@ -2,8 +2,8 @@ {block name="button"} -{if auth("service/config/edit")} - +{if auth("edit")} + {/if} {/block} @@ -11,7 +11,7 @@ {block name="content"}
-
+
强烈建议安装 YAR 扩展来实现接口通信,SOAP 不能正常显示接口的异常信息
@@ -19,7 +19,8 @@
-

开放平台服务 AppID

+ 开放平台服务 + AppID
-

开放平台服务 AppSecret

+ 开放平台服务 + AppSecret
-

开放平台消息校验 Token

+ 开放平台消息校验 + Token
-

开放平台消息加解密 AesKey

+ 开放平台消息加解密 + AesKey
-

授权事件接收 URL

+ 授权事件接收地址
-

微信消息与事件接收 URL

+ 微信消息与事件接收
-
{/block}