mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-10-29 14:01:07 +00:00
Merge branch 'v5.1.0dev' of https://gitee.com/ZhongBangKeJi/CRMEB into v5.1.0dev
This commit is contained in:
commit
3394013f74
@ -255,7 +255,7 @@ class Client extends BaseClient
|
||||
];
|
||||
|
||||
$res = $this->request('https://' . $header['Host'] . '/', 'PUT', [
|
||||
'bucket' => $bucket
|
||||
'Location' => $region
|
||||
], $header);
|
||||
|
||||
return $this->response($res);
|
||||
@ -335,9 +335,10 @@ class Client extends BaseClient
|
||||
{
|
||||
$header = [
|
||||
'Host' => $this->getRequestUrl($bucket, $region),
|
||||
'content-md5' => base64_encode(md5(json_encode($data), true))
|
||||
];
|
||||
$xml = $this->xmlBuild($data, 'CORSConfiguration', '');
|
||||
$res = $this->request('https://' . $header['Host'] . '/', 'PUT', [
|
||||
$xml = $this->xmlBuild($data, 'CORSConfiguration', 'CORSRule');
|
||||
$res = $this->request('https://' . $header['Host'] . '/cors ', 'PUT', [
|
||||
'bucket' => $bucket,
|
||||
'body' => $xml
|
||||
], $header);
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
namespace crmeb\services\upload\storage;
|
||||
|
||||
use crmeb\exceptions\AdminException;
|
||||
use crmeb\exceptions\UploadException;
|
||||
use crmeb\services\upload\extend\obs\Client as TyClient;
|
||||
use crmeb\services\upload\BaseUpload;
|
||||
|
||||
@ -220,12 +221,12 @@ class Obs extends BaseUpload
|
||||
public function setBucketCors(string $name, string $region)
|
||||
{
|
||||
try {
|
||||
$res = $this->app()->PutBucketCors($name, $region, [
|
||||
'AllowedHeaders' => ['*'],
|
||||
'AllowedMethods' => ['PUT', 'GET', 'POST', 'DELETE', 'HEAD'],
|
||||
'AllowedOrigins' => ['*'],
|
||||
'ExposeHeaders' => ['ETag', 'Content-Length', 'x-cos-request-id'],
|
||||
'MaxAgeSeconds' => 12
|
||||
$this->app()->PutBucketCors($name, $region, [
|
||||
'AllowedHeader' => ['*'],
|
||||
'AllowedMethod' => ['PUT', 'GET', 'POST', 'DELETE', 'HEAD'],
|
||||
'AllowedOrigin' => ['*'],
|
||||
'ExposeHeader' => ['ETag', 'Content-Length', 'x-cos-request-id'],
|
||||
'MaxAgeSeconds' => 100
|
||||
]);
|
||||
return true;
|
||||
} catch (\Throwable $e) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user