request->header('token', $this->param('token')); if (!$this->config['allowed_tourist_upload']) { $token && $this->auth($token); } else { $this->auth($token); } } /** * 上传 */ public function index() { Db::startTrans(); try { $data = (new \app\index\controller\Upload)->execute($this->user); Db::commit(); } catch (Exception $e) { Db::rollback(); return $this->response($e->getMessage(), [], 500); } return $this->response('success', $data); } }