From 6e790fb3ce1b00de71f5896d7419d738cce5dde4 Mon Sep 17 00:00:00 2001 From: wanghongjun <1445693971@qq,com> Date: Fri, 15 Sep 2023 16:14:56 +0800 Subject: [PATCH] =?UTF-8?q?=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/AdminZoneGoods.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controller/AdminZoneGoods.php b/app/controller/AdminZoneGoods.php index d06970b..9e6fa6d 100644 --- a/app/controller/AdminZoneGoods.php +++ b/app/controller/AdminZoneGoods.php @@ -84,10 +84,10 @@ class AdminZoneGoods extends BaseController 'image' => [ 'fileSize:10240000', // 文件大小不超过10M (10 * 1024 KB) 'fileExt:jpeg,jpg,png,gif' - ], - 'type' => 'require|in:1,2' + ] ]; validate($rule)->check($file); + validate(['type' => 'require|in:1,2'])->check($param); $image_path = $param['type'] == 1 ? 'topic' : 'background'; $path = Upload::uploadImage($file['image'],$image_path); return $this->renderSuccess('上传成功',['path' => $path,'url' => get_image_url($path)]);