diff --git a/app/controller/Domain.php b/app/controller/Domain.php
index 9542739..39f23d1 100644
--- a/app/controller/Domain.php
+++ b/app/controller/Domain.php
@@ -7,6 +7,7 @@ use think\facade\Db;
use think\facade\View;
use think\facade\Request;
use app\lib\DnsHelper;
+use Exception;
class Domain extends BaseController
{
@@ -253,9 +254,9 @@ class Domain extends BaseController
$minTTL = cache('min_ttl_'.$drow['id']);
if(empty($recordLine)){
$dns = DnsHelper::getModel($drow['aid'], $drow['name'], $drow['thirdid']);
- if(!$dns) return $this->alert('error', 'DNS模块不存在');
+ if(!$dns) throw new Exception('DNS模块不存在');
$recordLine = $dns->getRecordLine();
- if(!$recordLine) return $this->alert('error', '获取解析线路列表失败,'.$dns->getError());
+ if(!$recordLine) throw new Exception('获取解析线路列表失败,'.$dns->getError());
cache('record_line_'.$drow['id'], $recordLine, 604800);
$minTTL = $dns->getMinTTL();
if($minTTL){
diff --git a/app/lib/dns/dnspod.php b/app/lib/dns/dnspod.php
index 7f2af1d..81f16ec 100644
--- a/app/lib/dns/dnspod.php
+++ b/app/lib/dns/dnspod.php
@@ -12,6 +12,7 @@ class dnspod implements DnsInterface {
private $error;
private $domain;
private $domainid;
+ private $domainInfo;
function __construct($config){
$this->SecretId = $config['ak'];
@@ -24,7 +25,7 @@ class dnspod implements DnsInterface {
}
public function check(){
- if($this->getAccountInfo() != false){
+ if($this->getDomainList() != false){
return true;
}
return false;
@@ -194,6 +195,15 @@ class dnspod implements DnsInterface {
$list = [];
$this->processLineList($list, $data['LineList'], null);
return $list;
+ }else{
+ $data = $this->getRecordLineByGrade();
+ if($data){
+ $list = [];
+ foreach($data as $row){
+ $list[$row['LineId']] = ['name'=>$row['Name'], 'parent'=>null];
+ }
+ return $list;
+ }
}
return false;
}
@@ -211,11 +221,12 @@ class dnspod implements DnsInterface {
//获取域名概览信息
public function getDomainInfo(){
- $action = 'DescribeDomainPreview';
+ $action = 'DescribeDomain';
$param = ['Domain' => $this->domain];
$data = $this->send_reuqest($action, $param);
if($data){
- return $data['Domain'];
+ $this->domainInfo = $data['DomainInfo'];
+ return $data['DomainInfo'];
}
return false;
}
@@ -233,16 +244,36 @@ class dnspod implements DnsInterface {
//获取域名最低TTL
public function getMinTTL(){
+ if($this->domainInfo){
+ return $this->domainInfo['TTL'];
+ }
$PurviewList = $this->getDomainPurview();
if($PurviewList){
foreach($PurviewList as $row){
- if($row['Name'] == '记录 TTL 最低'){
+ if($row['Name'] == '记录 TTL 最低' || $row['Name'] == 'Min TTL value'){
return intval($row['Value']);
}
}
}
return false;
}
+
+ //获取等级允许的线路
+ public function getRecordLineByGrade(){
+ $action = 'DescribeRecordLineList';
+ $param = ['Domain' => $this->domain, 'DomainGrade' => ''];
+ $data = $this->send_reuqest($action, $param);
+ if($data){
+ $line_list = $data['LineList'];
+ if(!empty($data['LineGroupList'])){
+ foreach($data['LineGroupList'] as $row){
+ $line_list[] = ['Name' => $row['Name'], 'LineId' => $row['LineId']];
+ }
+ return $line_list;
+ }
+ }
+ return false;
+ }
//获取用户信息
public function getAccountInfo(){
diff --git a/app/middleware/ViewOutput.php b/app/middleware/ViewOutput.php
index c82db13..f27facc 100644
--- a/app/middleware/ViewOutput.php
+++ b/app/middleware/ViewOutput.php
@@ -18,7 +18,7 @@ class ViewOutput
{
View::assign('islogin', $request->islogin);
View::assign('user', $request->user);
- View::assign('cdnpublic', '//lib.baomitu.com/');
+ View::assign('cdnpublic', 'https://s4.zstatic.net/ajax/libs/');
View::assign('skin', getAdminSkin());
return $next($request);
}
diff --git a/app/view/dmonitor/task.html b/app/view/dmonitor/task.html
index aae129e..5cdcddd 100644
--- a/app/view/dmonitor/task.html
+++ b/app/view/dmonitor/task.html
@@ -33,8 +33,8 @@ tbody tr>td:nth-child(2){overflow: hidden;text-overflow: ellipsis;white-space: n
{/block}
{block name="script"}
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
diff --git a/app/view/domain/log.html b/app/view/domain/log.html
index 3af7053..c677f2d 100644
--- a/app/view/domain/log.html
+++ b/app/view/domain/log.html
@@ -16,8 +16,8 @@
{/block}
{block name="script"}
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+