diff --git a/README.md b/README.md index 5513c8c..dcf63d2 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,14 @@ $url = $disk->signUrl('file.md', $timeout); See more methods [laravel-filesystem-doc](https://laravel.com/docs/5.5/filesystem) +## 前端 web 直传配置 + +oss 直传有三种方式,当前扩展包使用的是最完整的 [服务端签名直传并设置上传回调](https://help.aliyun.com/document_detail/31927.html?spm=a2c4g.11186623.2.10.5602668eApjlz3#concept-qp2-g4y-5db) 方式,扩展包只生成前端页面上传所需的签名参数,前端上传实现可参考 [官方文档中的实例](https://help.aliyun.com/document_detail/31927.html?spm=a2c4g.11186623.2.10.5602668eApjlz3#concept-qp2-g4y-5db) 或自行搜索 + +```php +$config = $disk->signatureConfig($prefix, $callBackUrl, $expire); +``` + ## depend - [iidestiny/flysystem-oss](https://github.com/iiDestiny/flysystem-oss) diff --git a/src/OssStorageServiceProvider.php b/src/OssStorageServiceProvider.php index 17ce0a3..0de47e3 100644 --- a/src/OssStorageServiceProvider.php +++ b/src/OssStorageServiceProvider.php @@ -14,6 +14,7 @@ use Iidestiny\Flysystem\Oss\OssAdapter; use Iidestiny\Flysystem\Oss\Plugins\FileUrl; use Iidestiny\Flysystem\Oss\Plugins\SignUrl; +use Iidestiny\Flysystem\Oss\Plugins\SignatureConfig; use Illuminate\Support\ServiceProvider; use Illuminate\Support\Facades\Storage; use League\Flysystem\Filesystem; @@ -42,6 +43,7 @@ public function boot() $filesystem->addPlugin(new FileUrl()); $filesystem->addPlugin(new SignUrl()); + $filesystem->addPlugin(new SignatureConfig()); return $filesystem; });