正在显示
1 个修改的文件
包含
12 行增加
和
1 行删除
| @@ -209,10 +209,21 @@ class DomainInfoLogic extends BaseLogic | @@ -209,10 +209,21 @@ class DomainInfoLogic extends BaseLogic | ||
| 209 | $this->fail('获取项目数据失败'); | 209 | $this->fail('获取项目数据失败'); |
| 210 | } | 210 | } |
| 211 | $server_model = new ServerConfig(); | 211 | $server_model = new ServerConfig(); |
| 212 | - $server_info = $server_model->read(['id'=>$project_info['serve_id']],'init_domain'); | 212 | + $server_info = $server_model->read(['id'=>$project_info['serve_id']],['init_domain', 'host']); |
| 213 | if($server_info === false){ | 213 | if($server_info === false){ |
| 214 | $this->fail('获取服务器数据失败'); | 214 | $this->fail('获取服务器数据失败'); |
| 215 | } | 215 | } |
| 216 | + | ||
| 217 | + //域名是否都已经解析 | ||
| 218 | + if(!$this->check_cname($info['domain'], $server_info)){ | ||
| 219 | + $this->fail('域名' . $info['domain'] . '未解析至目标服务器'); | ||
| 220 | + } | ||
| 221 | + foreach ($this->param['other_domain']??[] as $other_domain){ | ||
| 222 | + if(!$this->check_cname($other_domain, $server_info)){ | ||
| 223 | + $this->fail('域名' . $other_domain . '未解析至目标服务器'); | ||
| 224 | + } | ||
| 225 | + } | ||
| 226 | + | ||
| 216 | //保存301跳转数据+其他域名 | 227 | //保存301跳转数据+其他域名 |
| 217 | $data = [ | 228 | $data = [ |
| 218 | 'other_domain'=>json_encode($this->param['other_domain'] ?? []), | 229 | 'other_domain'=>json_encode($this->param['other_domain'] ?? []), |
-
请 注册 或 登录 后发表评论