添加文件上传到阿里云OSS
This commit is contained in:
parent
8e453c15d9
commit
299a3b4498
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user