zoukankan      html  css  js  c++  java
  • 公众号开发-获取用户信息

    微信公众平台:https://mp.weixin.qq.com

    内部测试的appid REDIRECT_URI(用户登录链接地址) SECRET秘钥
    APPID = ed
    REDIRECT_URI = ed
    SCOPE = ed
    SECRET = ed


    1.获取用户code数据 (文档中有此链接)
    https://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=SCOPE&state=STATE#wechat_redirect
    (APPID、REDIRECT_URI 、SCOPE )
    获得CODE = 0618RgVf17UNcz0h1pXf1PVbVf18RgVR


    2.获取用户refresh_token
    https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code
    (SECRET 、CODE)

    3.再次获取用户access_token openid
    https://api.weixin.qq.com/sns/oauth2/refresh_token?appid=APPID&grant_type=refresh_token&refresh_token=REFRESH_TOKEN
    (appid、refresh_token)


    4.获取用户信息
    https://api.weixin.qq.com/sns/userinfo?access_token=ACCESS_TOKEN&openid=OPENID&lang=zh_CN
    (access_token、openid)

  • 相关阅读:
    别让猴子翻到背上
    python生成二维码
    50条经典爱情观
    智力测试题
    SQL数据库优化
    递归函数实现二分查找法
    软件开发类别
    递归函数的深度问题
    UVALive
    UVALive
  • 原文地址:https://www.cnblogs.com/Jessical8619/p/9913791.html
Copyright © 2011-2022 走看看