浏览代码

Update Config.php

Anyon 4 年之前
父节点
当前提交
e398ee4c33
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      app/data/controller/Config.php

+ 3 - 3
app/data/controller/Config.php

@@ -95,14 +95,14 @@ class Config extends Controller
      * @throws \think\db\exception\DbException
      * @throws \think\db\exception\ModelNotFoundException
      */
-    private function __sysdata($template = 'content')
+    private function __sysdata(string $template = 'content')
     {
         if ($this->request->isGet()) {
             $this->data = sysdata($this->skey);
             $this->fetch($template);
         } elseif ($this->request->isPost()) {
             if (is_string(input('data'))) {
-                $data = json_decode(input('data'), true);
+                $data = json_decode(input('data'), true) ?: [];
             } else {
                 $data = $this->request->post();
             }
@@ -121,7 +121,7 @@ class Config extends Controller
      * @throws \think\db\exception\DbException
      * @throws \think\db\exception\ModelNotFoundException
      */
-    private function __sysconf($template = 'wxapp')
+    private function __sysconf(string $template)
     {
         if ($this->request->isGet()) {
             $this->fetch($template);