From c56dc34a94438390dd4fc357b0d12374701dab70 Mon Sep 17 00:00:00 2001 From: WispX <1591788658@qq.com> Date: Mon, 2 Mar 2020 07:34:20 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D=20BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Upload.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/application/api/controller/Upload.php b/application/api/controller/Upload.php index 61ff4941..0ecb78c0 100644 --- a/application/api/controller/Upload.php +++ b/application/api/controller/Upload.php @@ -15,7 +15,13 @@ class Upload extends Base { public function initialize() { - if (!$this->config['open_api']) { + $config = []; + $configs = \app\common\model\Config::all(); + foreach ($configs as $key => &$value) { + $config[$value->name] = $value->value; + } + + if (!$config['open_api']) { $this->response('API is not open yet.', [], 500); }