|
@@ -136,22 +136,22 @@ class CNoticeController extends BaseController |
|
@@ -136,22 +136,22 @@ class CNoticeController extends BaseController |
|
136
|
* @time :2023/9/12 10:10
|
136
|
* @time :2023/9/12 10:10
|
|
137
|
*/
|
137
|
*/
|
|
138
|
public function curlGet($url){
|
138
|
public function curlGet($url){
|
|
139
|
- $curl = curl_init();
|
|
|
|
140
|
- curl_setopt_array($curl, array(
|
|
|
|
141
|
- CURLOPT_URL => 'https://demo.globalso.site/api/updateHtmlNotify/?project_id=1&type=2&route=1',
|
|
|
|
142
|
- CURLOPT_RETURNTRANSFER => true,
|
|
|
|
143
|
- CURLOPT_ENCODING => '',
|
|
|
|
144
|
- CURLOPT_MAXREDIRS => 10,
|
|
|
|
145
|
- CURLOPT_TIMEOUT => 30,
|
|
|
|
146
|
- CURLOPT_FOLLOWLOCATION => true,
|
|
|
|
147
|
-// CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
|
|
|
148
|
- CURLOPT_CUSTOMREQUEST => 'GET',
|
|
|
|
149
|
-// CURLOPT_HTTPHEADER => array(),
|
|
|
|
150
|
- ));
|
|
|
|
151
|
- $response = curl_exec($curl);
|
|
|
|
152
|
- @file_put_contents(storage_path('logs/lyh_error.log'), var_export($response, true) . PHP_EOL, FILE_APPEND);
|
|
|
|
153
|
- curl_close($curl);
|
|
|
|
154
|
- return $response;
|
139
|
+ $ch1 = curl_init();
|
|
|
|
140
|
+ $timeout = 0;
|
|
|
|
141
|
+ curl_setopt($ch1, CURLOPT_URL, $url);
|
|
|
|
142
|
+ curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
|
|
|
|
143
|
+ curl_setopt($ch1, CURLOPT_ENCODING, '');
|
|
|
|
144
|
+ curl_setopt($ch1, CURLOPT_MAXREDIRS, 10);
|
|
|
|
145
|
+ curl_setopt($ch1, CURLOPT_HTTPHEADER, array());
|
|
|
|
146
|
+ curl_setopt($ch1, CURLOPT_CONNECTTIMEOUT, $timeout);
|
|
|
|
147
|
+ curl_setopt($ch1, CURLOPT_SSL_VERIFYPEER, FALSE);
|
|
|
|
148
|
+ curl_setopt($ch1, CURLOPT_SSL_VERIFYHOST, FALSE);
|
|
|
|
149
|
+ curl_setopt($ch1, CURLOPT_FOLLOWLOCATION, true);
|
|
|
|
150
|
+ curl_setopt($ch1, CURLOPT_CUSTOMREQUEST, 'GET');
|
|
|
|
151
|
+ curl_setopt($ch1, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
|
|
|
|
152
|
+ $access_txt = curl_exec($ch1);
|
|
|
|
153
|
+ curl_close($ch1);
|
|
|
|
154
|
+ return json_decode($access_txt, true);
|
|
155
|
}
|
155
|
}
|
|
156
|
|
156
|
|
|
157
|
/**
|
157
|
/**
|