From 3a596cf42cb18cf1443b52a5f6e4fdb2a66efc16 Mon Sep 17 00:00:00 2001 From: Hanada Date: Wed, 18 Jun 2025 13:18:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=A0=B9=E6=8D=AE=E5=8C=BA?= =?UTF-8?q?=E5=9F=9F=E5=8A=A8=E6=80=81=E9=80=89=E6=8B=A9=E9=98=BF=E9=87=8C?= =?UTF-8?q?=E4=BA=91API=E7=9A=84=E7=AB=AF=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/lib/deploy/aliyun.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/app/lib/deploy/aliyun.php b/app/lib/deploy/aliyun.php index 7e361b9..7e42584 100644 --- a/app/lib/deploy/aliyun.php +++ b/app/lib/deploy/aliyun.php @@ -81,7 +81,14 @@ class aliyun implements DeployInterface $cert_name = str_replace('*.', '', $certInfo['subject']['CN']) . '-' . $certInfo['validFrom_time_t']; $serial_no = strtolower($certInfo['serialNumberHex']); - $client = new AliyunClient($this->AccessKeyId, $this->AccessKeySecret, 'cas.aliyuncs.com', '2020-04-07', $this->proxy); + if ($config['region'] == 'ap-southeast-1') { + $endpoint = 'cas.ap-southeast-1.aliyuncs.com'; + + } else { + $endpoint = 'cas.aliyuncs.com'; + } + + $client = new AliyunClient($this->AccessKeyId, $this->AccessKeySecret, $endpoint, '2020-04-07', $this->proxy); $param = [ 'Action' => 'ListUserCertificateOrder', 'Keyword' => $certInfo['subject']['CN'], @@ -162,7 +169,13 @@ class aliyun implements DeployInterface $sitename = $config['esa_sitename']; if (empty($sitename)) throw new Exception('ESA站点名称不能为空'); - $client = new AliyunClient($this->AccessKeyId, $this->AccessKeySecret, 'esa.cn-hangzhou.aliyuncs.com', '2024-09-10'); + if ($config['region'] == 'cn-hangzhou') { + $endpoint = 'esa.cn-hangzhou.aliyuncs.com'; + } else { + $endpoint = 'esa.ap-southeast-1.aliyuncs.com'; + } + + $client = new AliyunClient($this->AccessKeyId, $this->AccessKeySecret, $endpoint, '2024-09-10'); $param = [ 'Action' => 'ListSites', 'SiteName' => $sitename,