diff --git a/vendor/thinkcmf/cmf/src/lib/Upload.php b/vendor/thinkcmf/cmf/src/lib/Upload.php index 9dcc84f673bd55f788e0d287b79183dfb0f35a5a..c96bbe9310014615f05ca1c85896297deb9af22b 100644 --- a/vendor/thinkcmf/cmf/src/lib/Upload.php +++ b/vendor/thinkcmf/cmf/src/lib/Upload.php @@ -122,13 +122,15 @@ class Upload if (empty($userId)) { $token = $this->request->header('Authorization'); - if (substr($token, 0, 7) === 'Bearer ') { - $token = substr($token, 7); - } + if (empty($token)) { $token = $this->request->header('XX-Token'); } + if (substr($token, 0, 7) === 'Bearer ') { + $token = substr($token, 7); + } + $userId = Db::name('user_token')->where('token', $token)->field('user_id,token')->value('user_id'); } $targetDir = runtime_path() . "upload" . DIRECTORY_SEPARATOR . $userId . DIRECTORY_SEPARATOR; // 断点续传 need