mirror of
https://gitee.com/zoujingli/WeChatDeveloper.git
synced 2025-04-05 19:41:44 +08:00
[更新]修正网页授权获取用户资料接口
This commit is contained in:
parent
84bee4a600
commit
b9e220ecd1
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user