mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 15:32:48 +08:00
完成阿里云存储;
This commit is contained in:
25
extend/think/filesystem/driver/Alioss.php
Normal file
25
extend/think/filesystem/driver/Alioss.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace think\filesystem\driver;
|
||||
|
||||
use League\Flysystem\AdapterInterface;
|
||||
use think\filesystem\Driver;
|
||||
use Xxtime\Flysystem\Aliyun\OssAdapter;
|
||||
|
||||
class Alioss extends Driver
|
||||
{
|
||||
protected function createAdapter(): AdapterInterface
|
||||
{
|
||||
|
||||
$config = [
|
||||
'accessId' => sysconfig('upload', 'alioss_access_key_id'),
|
||||
'accessSecret' => sysconfig('upload', 'alioss_access_key_secret'),
|
||||
'endpoint' => sysconfig('upload', 'alioss_endpoint'),
|
||||
'bucket' => sysconfig('upload', 'alioss_bucket'),
|
||||
];
|
||||
|
||||
return new OssAdapter(
|
||||
$config
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user