正在显示
1 个修改的文件
包含
15 行增加
和
12 行删除
| @@ -264,6 +264,21 @@ class DomainInfoLogic extends BaseLogic | @@ -264,6 +264,21 @@ class DomainInfoLogic extends BaseLogic | ||
| 264 | } | 264 | } |
| 265 | } | 265 | } |
| 266 | 266 | ||
| 267 | + if(isset($this->param['amp_status']) && $this->param['amp_status'] == 1){ | ||
| 268 | + $domain_array = parse_url($info['domain']); | ||
| 269 | + $host = $domain_array['host'] ?? $domain_array['path']; | ||
| 270 | + $host_array = explode('.',$host); | ||
| 271 | + if(count($host_array) <= 2){ | ||
| 272 | + array_unshift($host_array,'m'); | ||
| 273 | + }else{ | ||
| 274 | + $host_array[0] = 'm'; | ||
| 275 | + } | ||
| 276 | + $amp_domain = implode('.',$host_array); | ||
| 277 | + if(!$this->check_cname($amp_domain, $server_info)){ | ||
| 278 | + $this->fail('AMP站点域名' . $amp_domain . '未解析至目标服务器'); | ||
| 279 | + } | ||
| 280 | + } | ||
| 281 | + | ||
| 267 | //保存301跳转数据+其他域名 | 282 | //保存301跳转数据+其他域名 |
| 268 | $data = [ | 283 | $data = [ |
| 269 | 'other_domain'=>json_encode($this->param['other_domain'] ?? []), | 284 | 'other_domain'=>json_encode($this->param['other_domain'] ?? []), |
| @@ -282,18 +297,6 @@ class DomainInfoLogic extends BaseLogic | @@ -282,18 +297,6 @@ class DomainInfoLogic extends BaseLogic | ||
| 282 | 297 | ||
| 283 | //amp站点生成证书 | 298 | //amp站点生成证书 |
| 284 | if($data['amp_status']){ | 299 | if($data['amp_status']){ |
| 285 | - $domain_array = parse_url($info['domain']); | ||
| 286 | - $host = $domain_array['host'] ?? $domain_array['path']; | ||
| 287 | - $host_array = explode('.',$host); | ||
| 288 | - if(count($host_array) <= 2){ | ||
| 289 | - array_unshift($host_array,'m'); | ||
| 290 | - }else{ | ||
| 291 | - $host_array[0] = 'm'; | ||
| 292 | - } | ||
| 293 | - $amp_domain = implode('.',$host_array); | ||
| 294 | - if(!$this->check_cname($amp_domain, $server_info)){ | ||
| 295 | - $this->fail('AMP站点域名' . $amp_domain . '未解析至目标服务器'); | ||
| 296 | - } | ||
| 297 | $this->setAmpDomainSsl($server_info['init_domain'],$info['domain']); | 300 | $this->setAmpDomainSsl($server_info['init_domain'],$info['domain']); |
| 298 | } | 301 | } |
| 299 | 302 |
-
请 注册 或 登录 后发表评论