Laravel/Lumen|Laravel/Lumen aliyun oss-sts
Lumen Laravel 5+. AliYun OSS-STS
https://github.com/bmslaravel/aliyun-sts
介绍:前端直传oss,后端获取授权TOKEN数据
Composer
composer require bmslaravel/aliyun-sts
Laravel/Lumen Service Register
- Laravel => config/app.php
Helium\Sts\AliYunSTSServiceProvider::class
- Lumen => bootstrap/app.php
$app->register(Helium\Sts\AliYunSTSServiceProvider::class);
- Laravel => config/app.php
'AliYunSTS' => Helium\Sts\Facades\AliYunSTS::class
- lumen => bootstrap/app.php
$app->withFacades(true, [ // ... Helium\Sts\Facades\AliYunSTS::class => 'AliYunSTS', ]);
- lumen copy
vendor/bmslaravel/src/config/sts.php
toconfig/sts.php
- Laravel vendor:publish
try{
$response = Helium\Sts\Facades\AliYunSTS::token();
dd($response);
// or
$config = config('sts');
$response = (new Helium\Sts\Sts($config))->token();
dd($response);
// or
$response = app('aliyun.sts')->token();
dd($response);
} catch (\Exception $exception) {
dd($exception);
}
Reference link 【Laravel/Lumen|Laravel/Lumen aliyun oss-sts】https://help.aliyun.com/document_detail/64041.html?spm=a2c4g.11186623.2.17.38165bd44oA7Q2#concept-64041-z
https://help.aliyun.com/document_detail/32069.html?spm=a2c4g.11186623.6.989.26a459662WQfhJ
https://help.aliyun.com/document_detail/100624.html?spm=a2c4g.11186623.2.10.683030ffnJJSmX#concept-xzh-nzk-2gb
推荐阅读
- laravel框架泛解
- Laravel|Laravel 实战项目(鲜花网)
- Laravel+vue公有/私有广播实战
- laravel|laravel 添加扩展包步骤
- 完全不一样的|完全不一样的 LaravelAdmin Windows Docker 搭建篇
- Laravel中schedule调度的运行机制
- laravel 8 修改默认的paginate分页模板
- 是的没错,我就是抄的。一个像|是的没错,我就是抄的。一个像 Laravel 那样好用的 go 语言的 SQL 查询构造器
- Laravel-Plugin|Laravel-Plugin 基于 Laravel 的插件机制解决方案
- Laravel基于RT模式实现分布式事务(全球首创支持子服务嵌套事务)