Skip to content

Commit

Permalink
feat(plugin): Web direct parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
iiDestiny committed Apr 3, 2019
1 parent 2e27f38 commit 63c42c6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions src/OssStorageServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -42,6 +43,7 @@ public function boot()

$filesystem->addPlugin(new FileUrl());
$filesystem->addPlugin(new SignUrl());
$filesystem->addPlugin(new SignatureConfig());

return $filesystem;
});
Expand Down

0 comments on commit 63c42c6

Please sign in to comment.