From 299a3b449846dbe2b5ac058736d9b4809bb38242 Mon Sep 17 00:00:00 2001 From: wangxiaowei Date: Wed, 21 Aug 2024 09:31:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=87=E4=BB=B6=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E5=88=B0=E9=98=BF=E9=87=8C=E4=BA=91OSS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/File.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/app/api/controller/File.php b/app/api/controller/File.php index 17ca4538..d832a245 100755 --- a/app/api/controller/File.php +++ b/app/api/controller/File.php @@ -23,10 +23,17 @@ namespace app\api\controller; use app\common\server\FileServer; use app\common\basics\Api; use app\common\server\JsonServer; +use app\common\utils\UploadAliOSS; class File extends Api { public $like_not_need_login = []; + + // 移动端上传图片路径匹配参数 + private static $APP_UPLOAD_PATH = [ + 'local_shop_add' => 'local_life_shop_goods' + ]; + /** * showdoc * @catalog 接口/上传文件 @@ -48,6 +55,21 @@ class File extends Api }catch(\Exception $e) { return JsonServer::error($e->getMessage()); } + } + // 上传图片到阿里云 + public function aliOSS() + { + try{ + dump($this->request->post()); + die; +// $result = UploadAliOSS::uploadImage(); +// if ($result['code'] == 1) { +// return JsonServer::success('上传成功', $result['data']); +// } +// return JsonServer::error('上传失败'); + }catch(\Exception $e) { + return JsonServer::error($e->getMessage()); + } } } \ No newline at end of file