From 80280c05806a8e738d5d60610c555da0965e64ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AD=A5=E5=87=A1=E7=BD=91=E7=BB=9C?= <334509+ibufan@user.noreply.gitee.com> Date: Tue, 26 Nov 2024 05:12:28 +0000 Subject: [PATCH] =?UTF-8?q?update=20vendor/thinkcmf/cmf/src/lib/Upload.php?= =?UTF-8?q?.=20=E5=85=88=E5=88=A4=E7=A9=BA=EF=BC=8C=E5=86=8D=E6=88=AA?= =?UTF-8?q?=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 步凡网络 <334509+ibufan@user.noreply.gitee.com> --- vendor/thinkcmf/cmf/src/lib/Upload.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vendor/thinkcmf/cmf/src/lib/Upload.php b/vendor/thinkcmf/cmf/src/lib/Upload.php index 9dcc84f67..c96bbe931 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 -- Gitee