From 408f9ac82ce94a6e691fe50fa1af1fe11f64b88e Mon Sep 17 00:00:00 2001 From: AirLind <1149527164@qq.com> Date: Sat, 19 Mar 2016 22:08:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DGITHUB=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E8=8E=B7=E5=8F=96=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复GITHUB信息无法获取问题 --- ThinkSDK/ThinkOauth.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ThinkSDK/ThinkOauth.class.php b/ThinkSDK/ThinkOauth.class.php index 38779d5..d8b1366 100644 --- a/ThinkSDK/ThinkOauth.class.php +++ b/ThinkSDK/ThinkOauth.class.php @@ -205,12 +205,14 @@ protected function url($api, $fix = ''){ * @return array $data 响应数据 */ protected function http($url, $params, $method = 'GET', $header = array(), $multi = false){ + $UserAgent = 'Mozilla/5.0 (Windows; U; Windows NT 5.2) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13'; $opts = array( CURLOPT_TIMEOUT => 30, CURLOPT_RETURNTRANSFER => 1, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false, CURLOPT_HTTPHEADER => $header + CURLOPT_USERAGENT => $UserAgent ); /* 根据请求类型设置特定参数 */ @@ -256,4 +258,4 @@ abstract protected function parseToken($result, $extend); * 获取当前授权用户的SNS标识 */ abstract public function openid(); -} \ No newline at end of file +}