From 38fc6e485054ea94c913c7e4d7c26eafba7e3842 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Thu, 16 Nov 2023 16:33:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=9B=BE=E7=89=87=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/adminapi/controller/UploadController.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/adminapi/controller/UploadController.php b/app/adminapi/controller/UploadController.php index 536d6c86..23247c10 100644 --- a/app/adminapi/controller/UploadController.php +++ b/app/adminapi/controller/UploadController.php @@ -47,6 +47,9 @@ class UploadController extends BaseAdminController public function taskImage(): Json { $params=$this->request->post(); + if (empty($_FILES['file'])) { + return $this->fail('请上传图片'); + } $result = curl_post_file(env('project.worker_domain').'/middleapi/upload/image', $_FILES['file']['tmp_name'], $_FILES['file']['name'], $_FILES['file']['type'],$this->reqHeader); if($result['code'] == 0){ return $this->fail($result['msg']); @@ -58,6 +61,9 @@ class UploadController extends BaseAdminController public function taskFile(): Json { $params=$this->request->post(); + if (empty($_FILES['file'])) { + return $this->fail('请上传图片'); + } $result = curl_post_file(env('project.worker_domain').'/middleapi/upload/file', $_FILES['file']['tmp_name'], $_FILES['file']['name'], $_FILES['file']['type'],$this->reqHeader); if($result['code'] == 0){ return $this->fail($result['msg']);