合并分支 'akun' 到 'master'
Akun 查看合并请求 !393
正在显示
1 个修改的文件
包含
16 行增加
和
12 行删除
| @@ -264,6 +264,22 @@ class DomainInfoLogic extends BaseLogic | @@ -264,6 +264,22 @@ class DomainInfoLogic extends BaseLogic | ||
| 264 | } | 264 | } |
| 265 | } | 265 | } |
| 266 | 266 | ||
| 267 | + //如果要开通amp站点,判断m域名是否已经解析 | ||
| 268 | + if(isset($this->param['amp_status']) && $this->param['amp_status'] == 1){ | ||
| 269 | + $domain_array = parse_url($info['domain']); | ||
| 270 | + $host = $domain_array['host'] ?? $domain_array['path']; | ||
| 271 | + $host_array = explode('.',$host); | ||
| 272 | + if(count($host_array) <= 2){ | ||
| 273 | + array_unshift($host_array,'m'); | ||
| 274 | + }else{ | ||
| 275 | + $host_array[0] = 'm'; | ||
| 276 | + } | ||
| 277 | + $amp_domain = implode('.',$host_array); | ||
| 278 | + if(!$this->check_cname($amp_domain, $server_info)){ | ||
| 279 | + $this->fail('AMP站点域名' . $amp_domain . '未解析至目标服务器'); | ||
| 280 | + } | ||
| 281 | + } | ||
| 282 | + | ||
| 267 | //保存301跳转数据+其他域名 | 283 | //保存301跳转数据+其他域名 |
| 268 | $data = [ | 284 | $data = [ |
| 269 | 'other_domain'=>json_encode($this->param['other_domain'] ?? []), | 285 | 'other_domain'=>json_encode($this->param['other_domain'] ?? []), |
| @@ -282,18 +298,6 @@ class DomainInfoLogic extends BaseLogic | @@ -282,18 +298,6 @@ class DomainInfoLogic extends BaseLogic | ||
| 282 | 298 | ||
| 283 | //amp站点生成证书 | 299 | //amp站点生成证书 |
| 284 | if($data['amp_status']){ | 300 | 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']); | 301 | $this->setAmpDomainSsl($server_info['init_domain'],$info['domain']); |
| 298 | } | 302 | } |
| 299 | 303 |
-
请 注册 或 登录 后发表评论