From d368a0190a9b8c2cef539f5205ef6013fa77906b Mon Sep 17 00:00:00 2001 From: net909 Date: Mon, 23 Jun 2025 17:45:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DAPI=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E8=AE=B0=E5=BD=95=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/Domain.php | 6 +- app/lib/deploy/aliyun.php | 6 +- app/utils/CheckUtils.php | 9 +- app/view/index/setpwd.html | 280 ++++++++++++++++++------------------- composer.lock | 2 +- 5 files changed, 155 insertions(+), 148 deletions(-) diff --git a/app/controller/Domain.php b/app/controller/Domain.php index 14e616d..fdb9730 100644 --- a/app/controller/Domain.php +++ b/app/controller/Domain.php @@ -536,7 +536,6 @@ class Domain extends BaseController $remark = input('post.remark', null, 'trim'); $recordinfo = input('post.recordinfo', null, 'trim'); - $recordinfo = json_decode($recordinfo, true); if (empty($recordid) || empty($name) || empty($type) || empty($value)) { return json(['code' => -1, 'msg' => '参数不能为空']); @@ -546,6 +545,7 @@ class Domain extends BaseController $recordid = $dns->updateDomainRecord($recordid, $name, $type, $value, $line, $ttl, $mx, $weight, $remark); if ($recordid) { if ($recordinfo) { + $recordinfo = json_decode($recordinfo, true); if (is_array($recordinfo['Value'])) $recordinfo['Value'] = implode(',', $recordinfo['Value']); if ($recordinfo['Name'] != $name || $recordinfo['Type'] != $type || $recordinfo['Value'] != $value) { $this->add_log($drow['name'], '修改解析', $recordinfo['Name'].' ['.$recordinfo['Type'].'] '.$recordinfo['Value'].' → '.$name.' ['.$type.'] '.$value.' (线路:'.$line.' TTL:'.$ttl.')'); @@ -572,7 +572,6 @@ class Domain extends BaseController $recordid = input('post.recordid', null, 'trim'); $recordinfo = input('post.recordinfo', null, 'trim'); - $recordinfo = json_decode($recordinfo, true); if (empty($recordid)) { return json(['code' => -1, 'msg' => '参数不能为空']); @@ -581,6 +580,7 @@ class Domain extends BaseController $dns = DnsHelper::getModel($drow['aid'], $drow['name'], $drow['thirdid']); if ($dns->deleteDomainRecord($recordid)) { if ($recordinfo) { + $recordinfo = json_decode($recordinfo, true); if (is_array($recordinfo['Value'])) $recordinfo['Value'] = implode(',', $recordinfo['Value']); $this->add_log($drow['name'], '删除解析', $recordinfo['Name'].' ['.$recordinfo['Type'].'] '.$recordinfo['Value'].' (线路:'.$recordinfo['Line'].' TTL:'.$recordinfo['TTL'].')'); } else { @@ -604,7 +604,6 @@ class Domain extends BaseController $recordid = input('post.recordid', null, 'trim'); $status = input('post.status', null, 'trim'); $recordinfo = input('post.recordinfo', null, 'trim'); - $recordinfo = json_decode($recordinfo, true); if (empty($recordid)) { return json(['code' => -1, 'msg' => '参数不能为空']); @@ -614,6 +613,7 @@ class Domain extends BaseController if ($dns->setDomainRecordStatus($recordid, $status)) { $action = $status == '1' ? '启用解析' : '暂停解析'; if ($recordinfo) { + $recordinfo = json_decode($recordinfo, true); if (is_array($recordinfo['Value'])) $recordinfo['Value'] = implode(',', $recordinfo['Value']); $this->add_log($drow['name'], $action, $recordinfo['Name'].' ['.$recordinfo['Type'].'] '.$recordinfo['Value'].' (线路:'.$recordinfo['Line'].' TTL:'.$recordinfo['TTL'].')'); } else { diff --git a/app/lib/deploy/aliyun.php b/app/lib/deploy/aliyun.php index 3f5a6ce..49f4baf 100644 --- a/app/lib/deploy/aliyun.php +++ b/app/lib/deploy/aliyun.php @@ -168,10 +168,10 @@ class aliyun implements DeployInterface $sitename = $config['esa_sitename']; if (empty($sitename)) throw new Exception('ESA站点名称不能为空'); - if ($config['region'] == 'cn-hangzhou') { - $endpoint = 'esa.cn-hangzhou.aliyuncs.com'; - } else { + if ($config['region'] == 'ap-southeast-1') { $endpoint = 'esa.ap-southeast-1.aliyuncs.com'; + } else { + $endpoint = 'esa.cn-hangzhou.aliyuncs.com'; } $client = new AliyunClient($this->AccessKeyId, $this->AccessKeySecret, $endpoint, '2024-09-10'); diff --git a/app/utils/CheckUtils.php b/app/utils/CheckUtils.php index d165d6e..bcd18b5 100644 --- a/app/utils/CheckUtils.php +++ b/app/utils/CheckUtils.php @@ -127,7 +127,14 @@ class CheckUtils } $timeout = 1; exec('ping -c 1 -w '.$timeout.' '.$target, $output, $return_var); - $usetime = !empty($output[1]) ? round(getSubstr($output[1], 'time=', ' ms')) : 0; + if (!empty($output[1])) { + if (strpos($output[1], '毫秒') !== false) { + $usetime = getSubstr($output[1], '时间=', ' 毫秒'); + } else { + $usetime = getSubstr($output[1], 'time=', ' ms'); + } + } + $usetime = !empty($usetime) ? round(trim($usetime)) : 0; $errmsg = null; if ($return_var !== 0) { $usetime = $usetime == 0 ? $timeout * 1000 : $usetime; diff --git a/app/view/index/setpwd.html b/app/view/index/setpwd.html index 2d59f1a..9b4f198 100644 --- a/app/view/index/setpwd.html +++ b/app/view/index/setpwd.html @@ -7,21 +7,21 @@

修改密码

+
+ + +
- - -
+ + +
- - -
-
- - -
-
- -
+ + + +
+ +
@@ -29,18 +29,18 @@

TOTP二次验证

-
-
- {if $user.totp_open == 1} - -
-
- {else} - -
- {/if} -
-
+
+
+ {if $user.totp_open == 1} + +
+
+ {else} + +
+ {/if} +
+
{/block} {block name="script"} @@ -78,110 +78,110 @@ {/block} \ No newline at end of file diff --git a/composer.lock b/composer.lock index a0fae49..7b35a77 100644 --- a/composer.lock +++ b/composer.lock @@ -1878,5 +1878,5 @@ "ext-ssh2": "*" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" }