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;