更新上传接口
This commit is contained in:
parent
0a4951091f
commit
4f1eeae989
@ -36,13 +36,15 @@ class Upload extends CatchController
|
||||
*/
|
||||
public function image(CatchRequest $request, CatchUpload $upload): \think\response\Json
|
||||
{
|
||||
$images = $request->file();
|
||||
$images = array_values($request->file());
|
||||
|
||||
if (!$images) {
|
||||
if (!count($images)) {
|
||||
throw new FailedException('请选择图片上传');
|
||||
}
|
||||
|
||||
return CatchResponse::success($upload->checkImages($images)->multiUpload($images['image']));
|
||||
return CatchResponse::success($upload->checkImages($images)->multiUpload(
|
||||
count($images) < 2 ? $images[0] : $images
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user