| 
...
 | 
...
 | 
@@ -57,7 +57,7 @@ public function checkDomainSsl() | 
| 
 | 
 | 
                 $site_domain_list = $this->bt->WebDoaminList($site_id);
 | 
| 
 | 
 | 
                 $apply_ssl_domain_list = [];
 | 
| 
 | 
 | 
                 foreach ($site_domain_list as $val) {
 | 
| 
 | 
 | 
                     if (strpos($val['name'], '*') === false && $this->check_domain_record($val['name'], ['domain'=>'','ip' => $site_ip])) {
 | 
| 
 | 
 | 
                     if (strpos($val['name'], '*') === false && $this->check_domain_record($val['name'], ['domain' => '', 'ip' => $site_ip])) {
 | 
| 
 | 
 | 
                         $apply_ssl_domain_list[] = $val['name'];
 | 
| 
 | 
 | 
                     }
 | 
| 
 | 
 | 
                 }
 | 
| 
...
 | 
...
 | 
@@ -96,9 +96,23 @@ public function checkDomainSsl() | 
| 
 | 
 | 
                     $amp_site_id = $amp_site_list['data'][0]['id'];
 | 
| 
 | 
 | 
                     $amp_host = $amp_site_list['data'][0]['name'];
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
                     //申请证书之前,还原主站配置
 | 
| 
 | 
 | 
                     $amp_config_before = file_get_contents(public_path('amp_site_default.txt'));
 | 
| 
 | 
 | 
                     $re_amp_config_before = $this->bt->SaveFileBody('/www/server/panel/vhost/nginx/' . $amp_host . '.conf', $amp_config_before, 'utf-8', 1);
 | 
| 
 | 
 | 
                     if (!($re_amp_config_before['status'] ?? false)) {
 | 
| 
 | 
 | 
                         throw new \Exception($re_amp_config_before['msg'] ?? '还原AMP站nginx配置失败');
 | 
| 
 | 
 | 
                     }
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
                     //设置站点证书
 | 
| 
 | 
 | 
                     $this->setDomainSsl($amp_site_id, $amp_host, [$amp_host]);
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
                     //申请证书之后,更新主站配置
 | 
| 
 | 
 | 
                     $amp_config_after = file_get_contents(public_path('amp_site_config.txt'));
 | 
| 
 | 
 | 
                     $re_amp_config_after = $this->bt->SaveFileBody('/www/server/panel/vhost/nginx/' . $amp_host . '.conf', $amp_config_after, 'utf-8', 1);
 | 
| 
 | 
 | 
                     if (!($re_amp_config_after['status'] ?? false)) {
 | 
| 
 | 
 | 
                         throw new \Exception($re_amp_config_after['msg'] ?? '更新AMP站nginx配置失败');
 | 
| 
 | 
 | 
                     }
 | 
| 
 | 
 | 
 
 | 
| 
 | 
 | 
                     $this->output('AMP站证书更新成功');
 | 
| 
 | 
 | 
                 }
 | 
| 
 | 
 | 
             }
 | 
...
 | 
...
 | 
 |