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)

  • 相关阅读:
    node下运行ts
    npm的一些基本配置设置
    windws 安装jdk
    java jdbc连接mysql
    struts2+jquery 实现ajax登陆
    struts2 零配置
    java 生成UUID
    ubuntu 换源
    ubuntu下安装redis
    安装 vsftpd
  • 原文地址:https://www.cnblogs.com/Jessical8619/p/9913791.html
Copyright © 2011-2022 走看看