|
...
|
...
|
@@ -261,26 +261,23 @@ class DomainInfoLogic extends BaseLogic |
|
|
|
$this->fail('获取项目数据失败');
|
|
|
|
}
|
|
|
|
$serverIpModel = new ServersIp();
|
|
|
|
$serversIpInfo = $serverIpModel->read(['id'=>$project_info['serve_id']],['servers_id','ip']);
|
|
|
|
$serversIpInfo = $serverIpModel->read(['id'=>$project_info['serve_id']],['servers_id','ip','domain']);
|
|
|
|
if($serversIpInfo === false){
|
|
|
|
$this->fail('获取服务器数据失败');
|
|
|
|
}
|
|
|
|
$serverModel = new Servers();
|
|
|
|
$serverInfo = $serverModel->read(['id'=>$serversIpInfo['servers_id']],['init_domain']);
|
|
|
|
$server_info = ['domain'=>$serverInfo['init_domain'],'ip'=>$serversIpInfo['ip']];
|
|
|
|
if($serversIpInfo['servers_id'] == 7){
|
|
|
|
if($serversIpInfo['servers_id'] == ServerConfig::SELF_TEST_ID){
|
|
|
|
$this->fail('请切换服务器,生成站点不能使用测试服务器');
|
|
|
|
}
|
|
|
|
if($serversIpInfo['servers_id'] == ServerConfig::SELF_SITE_ID){
|
|
|
|
$this->model->edit(['amp_status' => $this->param['amp_status'] ?? 0,],['id'=>$this->param['id']]);
|
|
|
|
$this->model->edit(['amp_status' => $this->param['amp_status'] ?? 0],['id'=>$this->param['id']]);
|
|
|
|
$this->fail('自建站服务器无法生成站点');
|
|
|
|
}
|
|
|
|
//域名是否都已经解析
|
|
|
|
if(!empty($info['domain']) && !$this->check_cname($info['domain'], $server_info)){
|
|
|
|
if(!empty($info['domain']) && !$this->check_cname($info['domain'], $serversIpInfo)){
|
|
|
|
$this->fail('域名' . $info['domain'] . '未解析至目标服务器');
|
|
|
|
}
|
|
|
|
foreach ($this->param['other_domain']??[] as $other_domain){
|
|
|
|
if($other_domain && !$this->check_cname($other_domain, $server_info)){
|
|
|
|
if($other_domain && !$this->check_cname($other_domain, $serversIpInfo)){
|
|
|
|
$this->fail('域名' . $other_domain . '未解析至目标服务器');
|
|
|
|
}
|
|
|
|
}
|
|
...
|
...
|
@@ -296,7 +293,7 @@ class DomainInfoLogic extends BaseLogic |
|
|
|
$host_array[0] = 'm';
|
|
|
|
}
|
|
|
|
$amp_domain = implode('.',$host_array);
|
|
|
|
if(!$this->check_cname($amp_domain, $server_info)){
|
|
|
|
if(!$this->check_cname($amp_domain, $serversIpInfo)){
|
|
|
|
$this->fail('AMP站点域名' . $amp_domain . '未解析至目标服务器');
|
|
|
|
}
|
|
|
|
}
|
|
...
|
...
|
@@ -385,14 +382,11 @@ class DomainInfoLogic extends BaseLogic |
|
|
|
if($this->param['is_create']){
|
|
|
|
//需要创建站点
|
|
|
|
$serverIpModel = new ServersIp();
|
|
|
|
$serversIpInfo = $serverIpModel->read(['id'=>$project_info['serve_id']],['servers_id','ip']);
|
|
|
|
$serversIpInfo = $serverIpModel->read(['id'=>$project_info['serve_id']],['servers_id','ip','domain']);
|
|
|
|
if($serversIpInfo === false){
|
|
|
|
$this->fail('获取服务器数据失败');
|
|
|
|
}
|
|
|
|
$serverModel = new Servers();
|
|
|
|
$serverInfo = $serverModel->read(['id'=>$serversIpInfo['servers_id']],['init_domain']);
|
|
|
|
$server_info = ['domain'=>$serverInfo['init_domain'],'ip'=>$serversIpInfo['ip']];
|
|
|
|
if($serversIpInfo['servers_id'] == 7){
|
|
|
|
if($serversIpInfo['servers_id'] == ServerConfig::SELF_TEST_ID){
|
|
|
|
$this->fail('请切换服务器,生成站点不能使用测试服务器');
|
|
|
|
}
|
|
|
|
if($serversIpInfo['servers_id'] == ServerConfig::SELF_SITE_ID){
|
|
...
|
...
|
@@ -412,7 +406,7 @@ class DomainInfoLogic extends BaseLogic |
|
|
|
if($has_info && ($has_info['project_id'] != $project_id || $has_info['language_id'] != $this->param['language_id'])){
|
|
|
|
$this->fail('自定义域名已被使用');
|
|
|
|
}
|
|
|
|
if(!$this->check_cname($this->param['custom_domain'], $server_info)){
|
|
|
|
if(!$this->check_cname($this->param['custom_domain'], $serversIpInfo)){
|
|
|
|
$this->fail('域名' . $this->param['custom_domain'] . '未解析至目标服务器');
|
|
|
|
}
|
|
|
|
}else{
|
...
|
...
|
|