Skip to content

Commit

Permalink
🐛 修复接口上传出现错误的 bug fix #83
Browse files Browse the repository at this point in the history
  • Loading branch information
wisp-x committed Mar 1, 2020
1 parent f791288 commit 4af1db0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions application/api/controller/Upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -32,7 +32,7 @@ public function index()
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) {
Expand Down
4 changes: 2 additions & 2 deletions application/index/controller/Upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ public function execute($user = null)
];

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;
Expand Down

0 comments on commit 4af1db0

Please sign in to comment.