From 4af1db0b1808df8f6a7b469e8550454dea014a79 Mon Sep 17 00:00:00 2001 From: WispX <1591788658@qq.com> Date: Mon, 2 Mar 2020 07:21:35 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=87=BA=E7=8E=B0=E9=94=99=E8=AF=AF=E7=9A=84?= =?UTF-8?q?=20bug=20fix=20#83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Upload.php | 4 ++-- application/index/controller/Upload.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/application/api/controller/Upload.php b/application/api/controller/Upload.php index ab435d61..70c64a87 100644 --- a/application/api/controller/Upload.php +++ b/application/api/controller/Upload.php @@ -16,7 +16,7 @@ class Upload extends Base public function initialize() { // 是否允许游客上传 - $token = $this->request->header('token', $this->request->input('token')); + $token = $this->request->header('token', $this->param('token')); if (!$this->config['allowed_tourist_upload']) { $token && $this->auth($token); } else { @@ -32,7 +32,7 @@ class Upload extends Base Db::startTrans(); try { - $data = (action('index/upload/execute'))->execute($this->user); + $data = (new \app\index\controller\Upload)->execute($this->user); Db::commit(); } catch (Exception $e) { diff --git a/application/index/controller/Upload.php b/application/index/controller/Upload.php index 7f1d7dc4..3acfb028 100755 --- a/application/index/controller/Upload.php +++ b/application/index/controller/Upload.php @@ -173,8 +173,8 @@ class Upload extends Base ]; if ($this->user) { - $data['quota'] = sprintf('%.2f', (float)$user->quota); - $data['use_quota'] = sprintf('%.2f', (float)$user->use_quota); + $data['quota'] = sprintf('%.2f', (float)$this->user->quota); + $data['use_quota'] = sprintf('%.2f', (float)$this->user->use_quota); } return $data;