refactor: 后台图片上传添加允许webp格式
This commit is contained in:
@@ -31,7 +31,7 @@ class Upload
|
||||
$max_size = strtobytes(env('ADMIN_API.MAX_IMAGE_SIZE', '1mb'));
|
||||
$validate = validate([
|
||||
'module' => 'require|max:64',
|
||||
'image' => "fileSize:$max_size|fileExt:jpg,jpeg,png,gif"
|
||||
'image' => "fileSize:$max_size|fileExt:jpg,jpeg,png,gif,webp"
|
||||
]);
|
||||
if (!$validate->check(['module' => $param['module'], 'image' => $file])) {
|
||||
return error($validate->getError());
|
||||
@@ -346,7 +346,7 @@ class Upload
|
||||
try {
|
||||
$max_size = strtobytes(env('ADMIN_API.MAX_ATTACHMENT_SIZE', '100mb'));
|
||||
$validate = validate([
|
||||
'attachment' => "fileSize:$max_size|fileExt:biz,bz,bz2,gz,tgz,zip,rar,7z,doc,docx,xls,xlsx,csv,ppt,pptx,pdf,txt,jpg,jpeg,png,ttf"
|
||||
'attachment' => "fileSize:$max_size|fileExt:biz,bz,bz2,gz,tgz,zip,rar,7z,doc,docx,xls,xlsx,csv,ppt,pptx,pdf,txt,jpg,jpeg,png,.webp,ttf"
|
||||
]);
|
||||
if (!$validate->check(['attachment' => $file])) {
|
||||
return error($validate->getError());
|
||||
|
||||
Reference in New Issue
Block a user