mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
Update Upload.php
This commit is contained in:
parent
cfc5071a8c
commit
a61baf954a
@ -77,9 +77,10 @@ class Upload extends Controller
|
||||
'hash.require' => '哈希不能为空!',
|
||||
'xext.require' => '后缀不能为空!',
|
||||
'size.require' => '大小不能为空!',
|
||||
'mime.require' => "类型不能为空!",
|
||||
'mime.default' => '',
|
||||
'status.value' => 1
|
||||
]));
|
||||
if (empty($file['mime'])) $file['mime'] = Storage::mime($file['xext']);
|
||||
if ($info = Storage::instance($data['uptype'])->info($data['key'], $safe, $name)) {
|
||||
$file->save(['xurl' => $info['url'], 'isfast' => 1, 'issafe' => $data['safe']]);
|
||||
$extr = ['id' => $file->id ?? 0, 'url' => $info['url'], 'key' => $info['key']];
|
||||
@ -128,8 +129,8 @@ class Upload extends Controller
|
||||
$data = $this->_vali([
|
||||
'id.require' => '编号不能为空!',
|
||||
'hash.require' => '哈希不能为空!',
|
||||
'uuid.value' => AdminService::getUserId()
|
||||
]);
|
||||
$data['uuid'] = AdminService::getUserId();
|
||||
$file = SystemFile::mk()->where($data)->findOrEmpty();
|
||||
if ($file->isEmpty()) $this->error('文件不存在!');
|
||||
if ($file->save(['status' => 2])) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user