作者 lyh

Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6

@@ -38,27 +38,25 @@ class EditCustomDomainBt implements ShouldQueue @@ -38,27 +38,25 @@ class EditCustomDomainBt implements ShouldQueue
38 */ 38 */
39 public function handle() 39 public function handle()
40 { 40 {
  41 + @file_put_contents(storage_path('logs/lyh_error.log'), var_export('生成证书---开始', true) . PHP_EOL, FILE_APPEND);
41 //获取域名数据 42 //获取域名数据
42 $domain_model = new CountryCustom(); 43 $domain_model = new CountryCustom();
43 $domain_info = $domain_model->read(['id' => $this->domain_id]); 44 $domain_info = $domain_model->read(['id' => $this->domain_id]);
44 if ($domain_info === false) { 45 if ($domain_info === false) {
45 return $this->output($domain_info['custom_domain'] . ':获取域名数据失败'); 46 return $this->output($domain_info['custom_domain'] . ':获取域名数据失败');
46 } 47 }
47 -  
48 //获取项目数据 48 //获取项目数据
49 $project_model = new Project(); 49 $project_model = new Project();
50 $project_info = $project_model->read(['id' => $domain_info['project_id']], 'serve_id'); 50 $project_info = $project_model->read(['id' => $domain_info['project_id']], 'serve_id');
51 if ($project_info === false) { 51 if ($project_info === false) {
52 return $this->output($domain_info['custom_domain'] . ':获取项目数据失败'); 52 return $this->output($domain_info['custom_domain'] . ':获取项目数据失败');
53 } 53 }
54 -  
55 //获取服务器数据 54 //获取服务器数据
56 $server_model = new ServerConfig(); 55 $server_model = new ServerConfig();
57 $server_info = $server_model->read(['id' => $project_info['serve_id']], ['init_domain', 'host']); 56 $server_info = $server_model->read(['id' => $project_info['serve_id']], ['init_domain', 'host']);
58 if ($server_info === false) { 57 if ($server_info === false) {
59 return $this->output($domain_info['custom_domain'] . ':获取服务器数据失败'); 58 return $this->output($domain_info['custom_domain'] . ':获取服务器数据失败');
60 } 59 }
61 -  
62 //编辑站点 60 //编辑站点
63 if ($domain_info['type'] == 2) { 61 if ($domain_info['type'] == 2) {
64 $api_url = 'http://' . $server_info['init_domain'] . '/api/setSsl'; 62 $api_url = 'http://' . $server_info['init_domain'] . '/api/setSsl';
@@ -70,6 +68,7 @@ class EditCustomDomainBt implements ShouldQueue @@ -70,6 +68,7 @@ class EditCustomDomainBt implements ShouldQueue
70 'other_domain' => [], 68 'other_domain' => [],
71 'is_https' => 1 69 'is_https' => 1
72 ]; 70 ];
  71 + @file_put_contents(storage_path('logs/lyh_error.log'), var_export('生成证书--参数:'.json_encode($api_param), true) . PHP_EOL, FILE_APPEND);
73 } else { 72 } else {
74 $api_url = 'http://' . $server_info['init_domain'] . '/api/applySsl'; 73 $api_url = 'http://' . $server_info['init_domain'] . '/api/applySsl';
75 $api_param = [ 74 $api_param = [
@@ -78,9 +77,11 @@ class EditCustomDomainBt implements ShouldQueue @@ -78,9 +77,11 @@ class EditCustomDomainBt implements ShouldQueue
78 'other_domain' => [], 77 'other_domain' => [],
79 'is_https' => 1 78 'is_https' => 1
80 ]; 79 ];
  80 + @file_put_contents(storage_path('logs/lyh_error.log'), var_export('生成证书--参数:'.json_encode($api_param), true) . PHP_EOL, FILE_APPEND);
81 } 81 }
82 try { 82 try {
83 $rs = HttpUtils::get($api_url, $api_param); 83 $rs = HttpUtils::get($api_url, $api_param);
  84 + @file_put_contents(storage_path('logs/lyh_error.log'), var_export('请求接口返回数据:'.$rs, true) . PHP_EOL, FILE_APPEND);
84 $rs = json_decode($rs, true); 85 $rs = json_decode($rs, true);
85 if (isset($rs['status']) && $rs['status'] == 200) { 86 if (isset($rs['status']) && $rs['status'] == 200) {
86 $this->output($domain_info['custom_domain'] . ':站点编辑成功'); 87 $this->output($domain_info['custom_domain'] . ':站点编辑成功');
@@ -88,6 +89,7 @@ class EditCustomDomainBt implements ShouldQueue @@ -88,6 +89,7 @@ class EditCustomDomainBt implements ShouldQueue
88 $this->output($domain_info['custom_domain'] . ':站点编辑失败,原因:' . ($rs['message'] ?? '')); 89 $this->output($domain_info['custom_domain'] . ':站点编辑失败,原因:' . ($rs['message'] ?? ''));
89 } 90 }
90 } catch (\Exception | GuzzleException $e) { 91 } catch (\Exception | GuzzleException $e) {
  92 + @file_put_contents(storage_path('logs/lyh_error.log'), var_export('错误情况打印:'.$rs, true) . PHP_EOL, FILE_APPEND);
91 $this->output($domain_info['custom_domain'] . ':站点编辑失败,原因:' . $e->getMessage()); 93 $this->output($domain_info['custom_domain'] . ':站点编辑失败,原因:' . $e->getMessage());
92 } 94 }
93 95