作者 lyh

gx

@@ -92,13 +92,15 @@ if (!function_exists('http_get')) { @@ -92,13 +92,15 @@ if (!function_exists('http_get')) {
92 charset = UTF-8"; 92 charset = UTF-8";
93 } 93 }
94 $ch1 = curl_init(); 94 $ch1 = curl_init();
95 - $timeout = 30; 95 + $timeout = 0;
96 curl_setopt($ch1, CURLOPT_URL, $url); 96 curl_setopt($ch1, CURLOPT_URL, $url);
97 - curl_setopt($ch1, CURLOPT_RETURNTRANSFER, 1); 97 + curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
98 curl_setopt($ch1, CURLOPT_HTTPHEADER, $header); 98 curl_setopt($ch1, CURLOPT_HTTPHEADER, $header);
99 curl_setopt($ch1, CURLOPT_CONNECTTIMEOUT, $timeout); 99 curl_setopt($ch1, CURLOPT_CONNECTTIMEOUT, $timeout);
100 curl_setopt($ch1, CURLOPT_SSL_VERIFYPEER, false); 100 curl_setopt($ch1, CURLOPT_SSL_VERIFYPEER, false);
101 - curl_setopt($ch1, CURLOPT_SSL_VERIFYHOST, false); 101 + curl_setopt($ch1, CURLOPT_FOLLOWLOCATION, true);
  102 + curl_setopt($ch1, CURLOPT_CUSTOMREQUEST, 'GET');
  103 + curl_setopt($ch1, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
102 $access_txt = curl_exec($ch1); 104 $access_txt = curl_exec($ch1);
103 curl_close($ch1); 105 curl_close($ch1);
104 return json_decode($access_txt, true); 106 return json_decode($access_txt, true);
@@ -73,10 +73,9 @@ class WebSettingLogic extends BaseLogic @@ -73,10 +73,9 @@ class WebSettingLogic extends BaseLogic
73 } 73 }
74 $updateNotifyModel->edit(['status'=>1],['project_id'=>$this->user['project_id'],'status'=>0]); 74 $updateNotifyModel->edit(['status'=>1],['project_id'=>$this->user['project_id'],'status'=>0]);
75 $urlStr = 'https://'.$this->user['domain'].'/api/updateHtmlNotify?project_id='.$this->user['project_id']; 75 $urlStr = 'https://'.$this->user['domain'].'/api/updateHtmlNotify?project_id='.$this->user['project_id'];
76 - $rs = $this->curl_get($urlStr);  
77 - var_dump($rs);  
78 - die();  
79 - return $this->success(); 76 +// $data = $this->curl_get($urlStr);
  77 + $data = http_get($urlStr);
  78 + return $this->success($data);
80 } 79 }
81 80
82 public function curl_get($url){ 81 public function curl_get($url){
@@ -93,6 +92,6 @@ class WebSettingLogic extends BaseLogic @@ -93,6 +92,6 @@ class WebSettingLogic extends BaseLogic
93 )); 92 ));
94 $response = curl_exec($curl); 93 $response = curl_exec($curl);
95 curl_close($curl); 94 curl_close($curl);
96 - return $response; 95 + return json_decode($response);
97 } 96 }
98 } 97 }