|
|
|
@ -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)]); |
|
|
|
|