!337 解决api模块上传文件获取不到uid的问题

Merge pull request !337 from Henry/repair
pull/311/MERGE
Karson 2021-07-19 06:36:30 +00:00 committed by Gitee
commit 5599170ce4
1 changed files with 2 additions and 1 deletions

View File

@ -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'],