From ab074da8390e603b4ce73efc7f23dab04de8eaaf Mon Sep 17 00:00:00 2001 From: net909 Date: Thu, 25 Jul 2024 20:39:21 +0800 Subject: [PATCH] fix --- app/lib/dns/cloudflare.php | 4 ++-- app/lib/dns/huawei.php | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/lib/dns/cloudflare.php b/app/lib/dns/cloudflare.php index 2ad2fab..20cdd7a 100644 --- a/app/lib/dns/cloudflare.php +++ b/app/lib/dns/cloudflare.php @@ -72,7 +72,7 @@ class cloudflare implements DnsInterface { 'Line' => $row['proxied'] ? '1' : '0', 'TTL' => $row['ttl'], 'MX' => isset($row['priority']) ? $row['priority'] : null, - 'Status' => $row['locked'] ? '0' : '1', + 'Status' => '1', 'Weight' => null, 'Remark' => $row['comment'], 'UpdateTime' => $row['modified_on'], @@ -102,7 +102,7 @@ class cloudflare implements DnsInterface { 'Line' => $data['result']['proxied'] ? '1' : '0', 'TTL' => $data['result']['ttl'], 'MX' => isset($data['result']['priority']) ? $data['result']['priority'] : null, - 'Status' => $data['result']['locked'] ? '0' : '1', + 'Status' => '1', 'Weight' => null, 'Remark' => $data['result']['comment'], 'UpdateTime' => $data['result']['modified_on'], diff --git a/app/lib/dns/huawei.php b/app/lib/dns/huawei.php index 446a7b9..1a24268 100644 --- a/app/lib/dns/huawei.php +++ b/app/lib/dns/huawei.php @@ -117,6 +117,7 @@ class huawei implements DnsInterface { //添加解析记录 public function addDomainRecord($Name, $Type, $Value, $Line = '0', $TTL = 600, $MX = 1, $Remark = null){ $Name = $this->getHost($Name); + if($Type == 'TXT' && substr($Value, 0, 1) != '"') $Value = '"'.$Value.'"'; $records = explode(',', $Value); $params = ['name' => $Name, 'type' => $this->convertType($Type), 'records' => $records, 'line'=>$Line, 'ttl' => intval($TTL), 'description' => $Remark]; if($Type == 'MX')$param['weight'] = intval($MX); @@ -127,6 +128,7 @@ class huawei implements DnsInterface { //修改解析记录 public function updateDomainRecord($RecordId, $Name, $Type, $Value, $Line = '0', $TTL = 600, $MX = 1, $Remark = null){ $Name = $this->getHost($Name); + if($Type == 'TXT' && substr($Value, 0, 1) != '"') $Value = '"'.$Value.'"'; $records = explode(',', $Value); $params = ['name' => $Name, 'type' => $this->convertType($Type), 'records' => $records, 'line'=>$Line, 'ttl' => intval($TTL), 'description' => $Remark]; if($Type == 'MX')$param['weight'] = intval($MX);