正在显示
1 个修改的文件
包含
6 行增加
和
1 行删除
| @@ -366,6 +366,7 @@ class DomainInfoLogic extends BaseLogic | @@ -366,6 +366,7 @@ class DomainInfoLogic extends BaseLogic | ||
| 366 | $this->fail('获取项目数据失败'); | 366 | $this->fail('获取项目数据失败'); |
| 367 | } | 367 | } |
| 368 | 368 | ||
| 369 | + $custom_model = new CountryCustom(); | ||
| 369 | if($this->param['is_create']){ | 370 | if($this->param['is_create']){ |
| 370 | //需要创建站点 | 371 | //需要创建站点 |
| 371 | $server_model = new ServerConfig(); | 372 | $server_model = new ServerConfig(); |
| @@ -383,6 +384,11 @@ class DomainInfoLogic extends BaseLogic | @@ -383,6 +384,11 @@ class DomainInfoLogic extends BaseLogic | ||
| 383 | $this->fail('自定义域名填写错误'); | 384 | $this->fail('自定义域名填写错误'); |
| 384 | } | 385 | } |
| 385 | $this->param['custom_domain'] = $domain_arr['host']; | 386 | $this->param['custom_domain'] = $domain_arr['host']; |
| 387 | + //判断域名是否已经被使用 | ||
| 388 | + $has_info = $custom_model->read(['custom_domain'=>$this->param['custom_domain']]); | ||
| 389 | + if($has_info && ($has_info['project_id'] != $project_id || $has_info['language_id'] != $this->param['language_id'])){ | ||
| 390 | + $this->fail('自定义域名已被使用'); | ||
| 391 | + } | ||
| 386 | if(!$this->check_cname($this->param['custom_domain'], $server_info)){ | 392 | if(!$this->check_cname($this->param['custom_domain'], $server_info)){ |
| 387 | $this->fail('域名' . $this->param['custom_domain'] . '未解析至目标服务器'); | 393 | $this->fail('域名' . $this->param['custom_domain'] . '未解析至目标服务器'); |
| 388 | } | 394 | } |
| @@ -392,7 +398,6 @@ class DomainInfoLogic extends BaseLogic | @@ -392,7 +398,6 @@ class DomainInfoLogic extends BaseLogic | ||
| 392 | $this->param['custom_domain'] = str_replace('//','',$this->param['custom_domain']); | 398 | $this->param['custom_domain'] = str_replace('//','',$this->param['custom_domain']); |
| 393 | } | 399 | } |
| 394 | 400 | ||
| 395 | - $custom_model = new CountryCustom(); | ||
| 396 | $info = $custom_model->read(['project_id'=>$project_id,'language_id'=>$this->param['language_id']]); | 401 | $info = $custom_model->read(['project_id'=>$project_id,'language_id'=>$this->param['language_id']]); |
| 397 | if($info === false){ | 402 | if($info === false){ |
| 398 | $this->param['project_id'] = $project_id; | 403 | $this->param['project_id'] = $project_id; |
-
请 注册 或 登录 后发表评论