收藏
回答

第三方平台代替小程序实现登录功能 code 换取 session_key 失败

根据文档(https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1492585163_FtTNA&token=&lang=zh_CN)里的内容,调用以下api接口,参数值确保都正确,但还是提示错误errcode:40029 ,errmsg:invalid code


https://api.weixin.qq.com/sns/component/jscode2session?appid=APPID&js_code=JSCODE&grant_type=authorization_code&component_appid=COMPONENT_APPID&component_access_token=ACCESS_TOKEN


请问,第三方平台怎么能获取到用户的具体信息呢?包括openid、头像信息等。

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

6 个回答

  • 旋转
    旋转
    2017-12-12

    wx.request函数的url参数贴出来看看。我也遇到同样的问题,后来发现是没有用程序中实际获得的res.code的值将官方例子中url内的js_code参数值替换掉,替换掉就可以获得session_key了

    2017-12-12
    有用
    回复
  • Kevin
    Kevin
    2017-09-06

    解决了,,code值 写错了,$code  没有加$

    2017-09-06
    有用
    回复
  • Kevin
    Kevin
    2017-09-06

    其中有一个人回复说,必须至少有一个审核通过的版本才ok, 这是什么意思?


    2017-09-06
    有用
    回复
  • Kevin
    Kevin
    2017-09-06

    搜到以上几个帖子,,但都不知道怎么解决的。。。code值没有问题,其他值都没有问题,

    2017-09-06
    有用
    回复
  • Kevin
    Kevin
    2017-09-06

    小程序第三方服务(开发小程序) code 换取 session_key 失败

    https://developers.weixin.qq.com/blogdetail?action=get_post_info&docid=5260bd9ca5296c0ed4a1f2bbd96a19a2&highline=component%2Fjscode2session&token=1319795903&lang=zh_CN


    微信小程序第三方平台接口 微信登录 提示 system error

    https://developers.weixin.qq.com/blogdetail?action=get_post_info&docid=36abfab1733e3aba70a153253fbc4f4b&highline=component%2Fjscode2session&token=1319795903&lang=zh_CN


    第三方调用 jscode2session 大概率返回失败

    https://developers.weixin.qq.com/blogdetail?action=get_post_info&docid=a51087e2e00c44483a472f2e55bfa472&highline=component%2Fjscode2session&token=1319795903&lang=zh_CN


    2017-09-06
    有用
    回复
  • 李文亮
    李文亮
    2017-09-05

    code值无效,仔细检查你的代码,正常的第三方平台获取具体信息就是根据官方文档来,有问题先用搜索引擎,或者搜索其人的问题。

    2017-09-05
    有用
    回复
登录 后发表内容