作者 刘锟

update

@@ -152,7 +152,7 @@ class DomainInfoLogic extends BaseLogic @@ -152,7 +152,7 @@ class DomainInfoLogic extends BaseLogic
152 * @author Akun 152 * @author Akun
153 * @date 2023/10/17 11:52 153 * @date 2023/10/17 11:52
154 */ 154 */
155 - public function setDomainSsl($initDomain,$domain,$rewrite,$other_domain) 155 + public function setDomainSsl($initDomain,$domain,$rewrite,$other_domain,$is_https)
156 { 156 {
157 if($this->param['type'] == 2){ 157 if($this->param['type'] == 2){
158 if(empty($this->param['key'])){ 158 if(empty($this->param['key'])){
@@ -167,11 +167,17 @@ class DomainInfoLogic extends BaseLogic @@ -167,11 +167,17 @@ class DomainInfoLogic extends BaseLogic
167 'private_key' => $this->param['key'], 167 'private_key' => $this->param['key'],
168 'cert' => $this->param['cert'], 168 'cert' => $this->param['cert'],
169 'rewrite'=>$rewrite, 169 'rewrite'=>$rewrite,
170 - 'other_domain'=>$other_domain 170 + 'other_domain'=>$other_domain,
  171 + 'is_https' => $is_https
171 ]; 172 ];
172 }else{ 173 }else{
173 $api_url = 'http://'.$initDomain.'/api/applySsl'; 174 $api_url = 'http://'.$initDomain.'/api/applySsl';
174 - $api_param = ['domain' => $domain,'rewrite'=>$rewrite,'other_domain'=>$other_domain]; 175 + $api_param = [
  176 + 'domain' => $domain,
  177 + 'rewrite'=>$rewrite,
  178 + 'other_domain'=>$other_domain,
  179 + 'is_https' => $is_https
  180 + ];
175 } 181 }
176 try { 182 try {
177 $rs = HttpUtils::get($api_url, $api_param); 183 $rs = HttpUtils::get($api_url, $api_param);
@@ -287,6 +293,7 @@ class DomainInfoLogic extends BaseLogic @@ -287,6 +293,7 @@ class DomainInfoLogic extends BaseLogic
287 'type'=>$this->param['type'], 293 'type'=>$this->param['type'],
288 'private_key' => $this->param['key'] ?? '', 294 'private_key' => $this->param['key'] ?? '',
289 'private_cert' => $this->param['cert'] ?? '', 295 'private_cert' => $this->param['cert'] ?? '',
  296 + 'is_https' => $this->param['is_https'] ?? 0,
290 'amp_status' => $this->param['amp_status'] ?? 0, 297 'amp_status' => $this->param['amp_status'] ?? 0,
291 'amp_type' => $this->param['amp_type'] ?? 0, 298 'amp_type' => $this->param['amp_type'] ?? 0,
292 'amp_private_key' => $this->param['amp_key'] ?? '', 299 'amp_private_key' => $this->param['amp_key'] ?? '',
@@ -294,7 +301,7 @@ class DomainInfoLogic extends BaseLogic @@ -294,7 +301,7 @@ class DomainInfoLogic extends BaseLogic
294 ]; 301 ];
295 $this->model->edit($data,['id'=>$this->param['id']]); 302 $this->model->edit($data,['id'=>$this->param['id']]);
296 //生成证书 303 //生成证书
297 - $this->setDomainSsl($server_info['init_domain'],$info['domain'],$this->param['extend_config'] ?? [],$this->param['other_domain'] ?? []); 304 + $this->setDomainSsl($server_info['init_domain'],$info['domain'],$this->param['extend_config'] ?? [],$this->param['other_domain'] ?? [],$this->param['is_https'] ?? 0);
298 305
299 //amp站点生成证书 306 //amp站点生成证书
300 if($data['amp_status']){ 307 if($data['amp_status']){