PFinal\Wechat\Service\OAuthService::getOauthUserInfo PHP Method

getOauthUserInfo() public static method

网页授权获取用户基本信息 流程第4步 拉取用户信息
public static getOauthUserInfo ( $openId, $accessToken ) : array
$openId
$accessToken
return array [ 'openid' //用户的唯一标识 'nickname' //用户昵称 'sex' //用户的性别,值为1时是男性,值为2时是女性,值为0时是未知 'province' //用户个人资料填写的省份 'city' //普通用户个人资料填写的城市 'country' //国家,如中国为CN 'headimgurl' //用户头像,最后一个数值代表正方形头像大小(有0、46、64、96、132数值可选,0代表640*640正方形头像),用户没有头像时该项为空 ]
    public static function getOauthUserInfo($openId, $accessToken)
    {
        $url = "https://api.weixin.qq.com/sns/userinfo?access_token={$accessToken}&openid={$openId}&lang=zh_CN";
        return parent::request($url);
    }