mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-10-30 06:20:50 +00:00
调整云存储上传
This commit is contained in:
parent
63527e0fa0
commit
7b732dabdb
@ -351,8 +351,7 @@ class StoreProduct extends AuthController
|
||||
if (!$key || !$contentType) {
|
||||
return app('json')->fail('缺少参数');
|
||||
}
|
||||
$url = $upload->getTempKeys($key, $path, $contentType);
|
||||
$re = ['url' => $url];
|
||||
$re = $upload->getTempKeys($key, $path, $contentType);
|
||||
} else {
|
||||
$re = $upload->getTempKeys();
|
||||
}
|
||||
|
||||
@ -431,6 +431,7 @@ class Client extends BaseClient
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 地域名称
|
||||
* @return \string[][]
|
||||
|
||||
@ -358,7 +358,10 @@ class Jdoss extends BaseUpload
|
||||
]
|
||||
);
|
||||
$request = $app->createPresignedRequest($cmd, $expires);
|
||||
return (string)$request->getUri();
|
||||
return [
|
||||
'url' => (string)$request->getUri(),
|
||||
'type' => 'JDOSS'
|
||||
];
|
||||
} catch (\Throwable $e) {
|
||||
return $this->setError($e->getMessage());
|
||||
}
|
||||
|
||||
@ -202,7 +202,7 @@ class Obs extends BaseUpload
|
||||
public function getDomian($name, $region)
|
||||
{
|
||||
try {
|
||||
$res = $this->app()->GetBucketDomain($name, $region);
|
||||
$res = $this->app()->getBucketDomain($name, $region);
|
||||
if ($res) {
|
||||
$domainRules = $res->toArray()['ListBucketCustomDomainsResult'];
|
||||
return array_column($domainRules, 'DomainName');
|
||||
@ -231,7 +231,7 @@ class Obs extends BaseUpload
|
||||
public function setBucketCors(string $name, string $region)
|
||||
{
|
||||
try {
|
||||
$this->app()->PutBucketCors($name, $region, [
|
||||
$this->app()->putBucketCors($name, $region, [
|
||||
'AllowedHeader' => ['*'],
|
||||
'AllowedMethod' => ['PUT', 'GET', 'POST', 'DELETE', 'HEAD'],
|
||||
'AllowedOrigin' => ['*'],
|
||||
@ -244,9 +244,17 @@ class Obs extends BaseUpload
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @date 2023/6/13
|
||||
*/
|
||||
public function getTempKeys()
|
||||
{
|
||||
// TODO: Implement getTempKeys() method.
|
||||
return [
|
||||
'access_key' => $this->accessKey,
|
||||
'secret_key' => $this->secretKey,
|
||||
'type' => 'OBS'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -331,7 +331,7 @@ class Tyoss extends BaseUpload
|
||||
public function getDomian($name, $region)
|
||||
{
|
||||
try {
|
||||
$res = $this->app()->GetBucketDomain($name, $region);
|
||||
$res = $this->app()->getBucketDomain($name, $region);
|
||||
if ($res) {
|
||||
$domainRules = $res->toArray()['ListBucketCustomDomainsResult'];
|
||||
return array_column($domainRules, 'DomainName');
|
||||
@ -360,7 +360,7 @@ class Tyoss extends BaseUpload
|
||||
public function setBucketCors(string $name, string $region)
|
||||
{
|
||||
try {
|
||||
$this->app()->PutBucketCors($name, $region, [
|
||||
$this->app()->putBucketCors($name, $region, [
|
||||
'AllowedHeader' => ['*'],
|
||||
'AllowedMethod' => ['PUT', 'GET', 'POST', 'DELETE', 'HEAD'],
|
||||
'AllowedOrigin' => ['*'],
|
||||
@ -372,9 +372,18 @@ class Tyoss extends BaseUpload
|
||||
return $this->setError($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @date 2023/6/13
|
||||
*/
|
||||
public function getTempKeys()
|
||||
{
|
||||
// TODO: Implement getTempKeys() method.
|
||||
return [
|
||||
'access_key' => $this->accessKey,
|
||||
'secret_key' => $this->secretKey,
|
||||
'type' => 'TYOSS'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user