From b9e220ecd12a93ae58cdda17ac51310eba6a2655 Mon Sep 17 00:00:00 2001 From: Anyon Date: Mon, 5 Feb 2018 10:19:48 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=9B=B4=E6=96=B0]=E4=BF=AE=E6=AD=A3=E7=BD=91?= =?UTF-8?q?=E9=A1=B5=E6=8E=88=E6=9D=83=E8=8E=B7=E5=8F=96=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E8=B5=84=E6=96=99=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WeChat/Oauth.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/WeChat/Oauth.php b/WeChat/Oauth.php index 1925881..636ae56 100644 --- a/WeChat/Oauth.php +++ b/WeChat/Oauth.php @@ -77,16 +77,14 @@ class Oauth extends BasicWeChat /** * 拉取用户信息(需scope为 snsapi_userinfo) + * @param string $access_token 网页授权接口调用凭证,注意:此access_token与基础支持的access_token不同 * @param string $openid 用户的唯一标识 * @param string $lang 返回国家地区语言版本,zh_CN 简体,zh_TW 繁体,en 英语 * @return array - * @throws Exceptions\InvalidResponseException - * @throws Exceptions\LocalCacheException */ - public function getUserInfo($openid, $lang = 'zh_CN') + public function getUserInfo($access_token, $openid, $lang = 'zh_CN') { - $url = "https://api.weixin.qq.com/sns/userinfo?access_token=ACCESS_TOKEN&openid={$openid}&lang={$lang}"; - $this->registerApi($url, __FUNCTION__, func_get_args()); + $url = "https://api.weixin.qq.com/sns/userinfo?access_token={$access_token}&openid={$openid}&lang={$lang}"; return $this->httpGetForJson($url); }