正在显示
1 个修改的文件
包含
25 行增加
和
7 行删除
| @@ -86,6 +86,26 @@ class DomainInfo extends Command | @@ -86,6 +86,26 @@ class DomainInfo extends Command | ||
| 86 | continue; | 86 | continue; |
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | + $domain_array = parse_url($v['domain']); | ||
| 90 | + $host = $domain_array['host'] ?? $domain_array['path']; | ||
| 91 | + $host_array = explode('.', $host); | ||
| 92 | + | ||
| 93 | + //判断泛域名解析情况,并更改项目泛域名解析状态 | ||
| 94 | + $host_array_any = $host_array; | ||
| 95 | + if (count($host_array_any) <= 2) { | ||
| 96 | + array_unshift($host_array_any, '*'); | ||
| 97 | + } else { | ||
| 98 | + $host_array_any[0] = '*'; | ||
| 99 | + } | ||
| 100 | + $any_domain = implode('.', $host_array_any); | ||
| 101 | + $rand_str = generateRandomString(3); | ||
| 102 | + if (check_domain_record(str_replace('*', $rand_str, $any_domain), $servers_ip_info)) { | ||
| 103 | + $is_analysis = 1; | ||
| 104 | + } else { | ||
| 105 | + $is_analysis = 0; | ||
| 106 | + } | ||
| 107 | + $projectModel->edit(['is_analysis' => $is_analysis], ['id' => $v['project_id']]); | ||
| 108 | + | ||
| 89 | if ($servers_ip_info['servers_id'] == ServerConfig::SELF_SITE_ID) { | 109 | if ($servers_ip_info['servers_id'] == ServerConfig::SELF_SITE_ID) { |
| 90 | //自建站项目,直接获取主站证书有效期并更新 | 110 | //自建站项目,直接获取主站证书有效期并更新 |
| 91 | $ssl_time = $this->getDomainSslTime($v['domain']); | 111 | $ssl_time = $this->getDomainSslTime($v['domain']); |
| @@ -153,15 +173,13 @@ class DomainInfo extends Command | @@ -153,15 +173,13 @@ class DomainInfo extends Command | ||
| 153 | } | 173 | } |
| 154 | 174 | ||
| 155 | if ($v['amp_status'] == 1) { | 175 | if ($v['amp_status'] == 1) { |
| 156 | - $domain_array = parse_url($v['domain']); | ||
| 157 | - $host = $domain_array['host'] ?? $domain_array['path']; | ||
| 158 | - $host_array = explode('.', $host); | ||
| 159 | - if (count($host_array) <= 2) { | ||
| 160 | - array_unshift($host_array, 'm'); | 176 | + $host_array_amp = $host_array; |
| 177 | + if (count($host_array_amp) <= 2) { | ||
| 178 | + array_unshift($host_array_amp, 'm'); | ||
| 161 | } else { | 179 | } else { |
| 162 | - $host_array[0] = 'm'; | 180 | + $host_array_amp[0] = 'm'; |
| 163 | } | 181 | } |
| 164 | - $amp_domain = implode('.', $host_array); | 182 | + $amp_domain = implode('.', $host_array_amp); |
| 165 | 183 | ||
| 166 | if ($servers_ip_info['servers_id'] != ServerConfig::SELF_SITE_ID) { | 184 | if ($servers_ip_info['servers_id'] != ServerConfig::SELF_SITE_ID) { |
| 167 | //过滤已解析到别的ip的AMP域名 | 185 | //过滤已解析到别的ip的AMP域名 |
-
请 注册 或 登录 后发表评论