|
...
|
...
|
@@ -50,7 +50,7 @@ class CNoticeController extends BaseController |
|
|
|
}
|
|
|
|
$urlStr = $this->getString($this->param['type'],$this->param['page']);
|
|
|
|
@file_put_contents(storage_path('logs/lyh_error.log'), var_export($urlStr, true) . PHP_EOL, FILE_APPEND);
|
|
|
|
$this->curlGet($urlStr);
|
|
|
|
curlGet($urlStr);
|
|
|
|
$this->response('更新成功');
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -117,32 +117,6 @@ class CNoticeController extends BaseController |
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :curl请求
|
|
|
|
* @name :curlGet
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/9/12 10:10
|
|
|
|
*/
|
|
|
|
public function curlGet($url){
|
|
|
|
$ch1 = curl_init();
|
|
|
|
$timeout = 0;
|
|
|
|
curl_setopt($ch1, CURLOPT_URL, $url);
|
|
|
|
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
|
|
|
|
curl_setopt($ch1, CURLOPT_ENCODING, '');
|
|
|
|
curl_setopt($ch1, CURLOPT_MAXREDIRS, 10);
|
|
|
|
curl_setopt($ch1, CURLOPT_HTTPHEADER, array());
|
|
|
|
curl_setopt($ch1, CURLOPT_CONNECTTIMEOUT, $timeout);
|
|
|
|
curl_setopt($ch1, CURLOPT_SSL_VERIFYPEER, FALSE);
|
|
|
|
curl_setopt($ch1, CURLOPT_SSL_VERIFYHOST, FALSE);
|
|
|
|
curl_setopt($ch1, CURLOPT_FOLLOWLOCATION, true);
|
|
|
|
curl_setopt($ch1, CURLOPT_CUSTOMREQUEST, 'GET');
|
|
|
|
curl_setopt($ch1, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
|
|
|
|
$access_txt = curl_exec($ch1);
|
|
|
|
curl_close($ch1);
|
|
|
|
return json_decode($access_txt, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :生成一条更新记录
|
|
|
|
* @name :addProgress
|
|
|
|
* @author :lyh
|
|
...
|
...
|
@@ -203,4 +177,5 @@ class CNoticeController extends BaseController |
|
|
|
}
|
|
|
|
$this->response('success',Code::SUCCESS,$lists);
|
|
|
|
}
|
|
|
|
|
|
|
|
} |
...
|
...
|
|