本地生活商品图片上传到阿里云OSS

This commit is contained in:
wangxiaowei 2024-08-21 11:07:15 +08:00
parent 1b34273b31
commit f451640b99

@ -62,7 +62,8 @@ class File extends Api
{
try{
$post = $this->request->post();
if (is_array(self::$APP_UPLOAD_PATH[$post['type']])) {
if (isset(self::$APP_UPLOAD_PATH[$post['type']])) {
$path = self::$APP_UPLOAD_PATH[$post['type']];
// 本地生活商家上传商品
if ($post['type'] === 'local_shop_add' && $post['lstore_id'] > 0) {
@ -70,11 +71,8 @@ class File extends Api
} else {
return JsonServer::error('缺少参数');
}
dump($path);
dump($post);die;
$result = UploadAliOSS::uploadImage($path);
dump($result);die;
if ($result['code'] == 1) {
return JsonServer::success('上传成功', $result['data']);
}