收藏
回答

通过code换取网页授权access_token 和 拉取用户信息 均未返回unionid

https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/Wechat_webpage_authorization.html


通过code换取网页授权access_token

 Code: 041cQ8ll2nWy5c42enol2R2DZX2cQ8ly
响应:
{
    "access_token":"73_NSpWjmw0mXLvwFwYA8J8iJXECda9jWN3U1wb79_u8D2d1qLDYlQT0QBsCbop2-2w-m09pOSBtl3F5xkj4zmBtytllbcuc6GxWgRch4YIHHI",
    "refresh_token":"73_ThqPeIUCpRtrNx0GRf6e87z3rdXmjIKe44uxwEBiBJhE6140GQDYkzSL3dtRnHvPK91w_VHY3UkONqAr5fsB2znIeHQy6plnpL6LLoRT4hQ",
    "openid":"on_I362w6EIVWnpo4ttq7i5-Sc9s",
    "scope":"snsapi_userinfo",
    "expires_in":7200
}


拉取用户信息

响应:
{
    "country":"",
    "province":"",
    "city":"",
    "openid":"on_I362w6EIVWnpo4ttq7i5-Sc9s",
    "sex":0,
    "nickname":"æ²\u0089迷学习",
    "headimgurl":"https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTKXLMv85Sk2x0MxR9aPOIC9QxWJT5NiasiaoomDPg5BcNuQoicOQwlSY0bw2drjrBmmZt9TyEa7h3yQw/132",
    "language":"",
    "privilege":[

    ]
}
回答关注问题邀请回答
收藏

2 个回答

  • CRMEB
    CRMEB
    2023-09-27

    只有开放平台才能获取到

    2023-09-27
    有用
    回复
  • 路人
    路人
    2023-09-27

    说明接口请求的appid没有绑定开放平台

    2023-09-27
    有用
    回复
登录 后发表内容