作者 lyh

gx登录生成token

... ... @@ -61,7 +61,7 @@ if (!function_exists('http_post')) {
* @param type $url
* @param type $post_data
*/
function http_post($url, $post_data, $header = [],$is_json = true)
function http_post($url, $post_data, $header = [],$is_json = true,$timeout = 60)
{
if (empty($header)) {
$header = array(
... ... @@ -73,6 +73,7 @@ if (!function_exists('http_post')) {
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)');
... ...
... ... @@ -301,9 +301,12 @@ class CNoticeController extends BaseController
'language'=> $language,
'is_sitemap' => $is_sitemap
];
// http_post($c_url, json_encode($c_param));
try {
http_post($c_url, json_encode($c_param));
}catch (\Exception $e){
NoticeLog::createLog(NoticeLog::GENERATE_PAGE, json_encode(['c_url'=>$c_url,'c_params'=>$c_param]));
}
}
$this->response('更新中请稍后, 更新完成将会发送站内信通知更新结果!');
}
... ...