From 9b4d4c78ddb386d7b412e47efcdfca6fb7fd0a85 Mon Sep 17 00:00:00 2001 From: Henry Date: Mon, 12 Jul 2021 14:10:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3api=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E8=8E=B7=E5=8F=96=E4=B8=8D?= =?UTF-8?q?=E5=88=B0uid=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common/library/Upload.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/common/library/Upload.php b/application/common/library/Upload.php index daccab86a..66afc1dc8 100644 --- a/application/common/library/Upload.php +++ b/application/common/library/Upload.php @@ -354,9 +354,10 @@ class Upload $this->file = $file; $category = request()->post('category'); $category = array_key_exists($category, config('site.attachmentcategory') ?? []) ? $category : ''; + $auth = Auth::instance(); $params = array( 'admin_id' => (int)session('admin.id'), - 'user_id' => (int)cookie('uid'), + 'user_id' => (int)$auth->id, 'filename' => substr(htmlspecialchars(strip_tags($this->fileInfo['name'])), 0, 100), 'category' => $category, 'filesize' => $this->fileInfo['size'], -- Gitee