|
...
|
...
|
@@ -152,7 +152,7 @@ class DomainInfoLogic extends BaseLogic |
|
|
|
* @author Akun
|
|
|
|
* @date 2023/10/17 11:52
|
|
|
|
*/
|
|
|
|
public function setDomainSsl($initDomain,$domain,$rewrite,$other_domain)
|
|
|
|
public function setDomainSsl($initDomain,$domain,$rewrite,$other_domain,$is_https)
|
|
|
|
{
|
|
|
|
if($this->param['type'] == 2){
|
|
|
|
if(empty($this->param['key'])){
|
|
...
|
...
|
@@ -167,11 +167,17 @@ class DomainInfoLogic extends BaseLogic |
|
|
|
'private_key' => $this->param['key'],
|
|
|
|
'cert' => $this->param['cert'],
|
|
|
|
'rewrite'=>$rewrite,
|
|
|
|
'other_domain'=>$other_domain
|
|
|
|
'other_domain'=>$other_domain,
|
|
|
|
'is_https' => $is_https
|
|
|
|
];
|
|
|
|
}else{
|
|
|
|
$api_url = 'http://'.$initDomain.'/api/applySsl';
|
|
|
|
$api_param = ['domain' => $domain,'rewrite'=>$rewrite,'other_domain'=>$other_domain];
|
|
|
|
$api_param = [
|
|
|
|
'domain' => $domain,
|
|
|
|
'rewrite'=>$rewrite,
|
|
|
|
'other_domain'=>$other_domain,
|
|
|
|
'is_https' => $is_https
|
|
|
|
];
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
$rs = HttpUtils::get($api_url, $api_param);
|
|
...
|
...
|
@@ -287,6 +293,7 @@ class DomainInfoLogic extends BaseLogic |
|
|
|
'type'=>$this->param['type'],
|
|
|
|
'private_key' => $this->param['key'] ?? '',
|
|
|
|
'private_cert' => $this->param['cert'] ?? '',
|
|
|
|
'is_https' => $this->param['is_https'] ?? 0,
|
|
|
|
'amp_status' => $this->param['amp_status'] ?? 0,
|
|
|
|
'amp_type' => $this->param['amp_type'] ?? 0,
|
|
|
|
'amp_private_key' => $this->param['amp_key'] ?? '',
|
|
...
|
...
|
@@ -294,7 +301,7 @@ class DomainInfoLogic extends BaseLogic |
|
|
|
];
|
|
|
|
$this->model->edit($data,['id'=>$this->param['id']]);
|
|
|
|
//生成证书
|
|
|
|
$this->setDomainSsl($server_info['init_domain'],$info['domain'],$this->param['extend_config'] ?? [],$this->param['other_domain'] ?? []);
|
|
|
|
$this->setDomainSsl($server_info['init_domain'],$info['domain'],$this->param['extend_config'] ?? [],$this->param['other_domain'] ?? [],$this->param['is_https'] ?? 0);
|
|
|
|
|
|
|
|
//amp站点生成证书
|
|
|
|
if($data['amp_status']){
|
...
|
...
|
|