作者 lyh

gx

... ... @@ -100,6 +100,7 @@ if (!function_exists('http_get')) {
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch1, CURLOPT_ENCODING, '');
curl_setopt($ch1, CURLOPT_MAXREDIRS, 10);
curl_setopt($ch1, CURLOPT_TIMEOUT, 120);
curl_setopt($ch1, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch1, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch1, CURLOPT_FOLLOWLOCATION, true);
... ...
... ... @@ -313,7 +313,7 @@ class NewsController extends BaseController
],[
'keyword.required' => 'keyword不能为空',
]);
$data = http_get('http://gnews.globalso.com/gnews_news.php?keyword='.$this->param['keyword']);
$data = http_get('http://gnews.globalso.com/gnews_news.php?keyword='.$this->param['keyword'],['charset=utf-8']);
$this->response('success',Code::SUCCESS,$data);
}
}
... ...