From fb162f59058ed50d1d7a8bf626567228ac589d3c Mon Sep 17 00:00:00 2001 From: Gosowong <1329847115@qq.com> Date: Tue, 6 Jun 2023 14:11:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E4=BA=AC=E4=B8=9C?= =?UTF-8?q?=E4=BA=91=E7=BB=91=E5=AE=9A=E5=9F=9F=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/crmeb/services/upload/storage/Jdoss.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/crmeb/crmeb/services/upload/storage/Jdoss.php b/crmeb/crmeb/services/upload/storage/Jdoss.php index 057753eb5..b0efc4297 100644 --- a/crmeb/crmeb/services/upload/storage/Jdoss.php +++ b/crmeb/crmeb/services/upload/storage/Jdoss.php @@ -292,7 +292,20 @@ class Jdoss extends BaseUpload public function bindDomian(string $name, string $domain, string $region = null) { - // TODO: Implement bindDomian() method. + try { + $this->app()->putBucketWebsite([ + 'Bucket' => $name, + 'WebsiteConfiguration' => [ + 'RedirectAllRequestsTo' => [ + 'HostName' => $domain, + 'Protocol' => 'http' + ] + ] + ]); + return true; + } catch (\Throwable $e) { + return $this->setError($e->getMessage()); + } } public function setBucketCors(string $name, string $region) @@ -314,7 +327,7 @@ class Jdoss extends BaseUpload ] ]); return true; - } catch (AcmException $e) { + } catch (\Throwable $e) { return $this->setError($e->getMessage()); } } @@ -336,7 +349,7 @@ class Jdoss extends BaseUpload ]); $request = $app->createPresignedRequest($cmd, $expires); return (string)$request->getUri(); - } catch (AcmException $e) { + } catch (\Throwable $e) { return $this->setError($e->getMessage()); } }