作者 lyh
@@ -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'] ?? []),