zoukankan      html  css  js  c++  java
  • 网站微信登陆接口(微信开放平台)

    第一步:

    https://open.weixin.qq.com/ 去这里注册登记,创建网站应用

    ,填写资料的时候注意网站的备案过的,有域名回调域填域名。不用具体到页面。

    通过后会得到AppID和AppSecret

    第二步:

    网站跳转, 请求CODE,提供 APPID,REDIRECT_URI

    https://open.weixin.qq.com/connect/qrconnect?
    appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=SCOPE&state=STATE#wechat_redirect

    其中state参数是可选,redirect_uri是回调地址,scope填写snsapi_login,appid填写审核通过后的AppID,其余不变。通过后会跳转到回调页!(可以自己手动拼接测试,C#代码如下)

    第三步:

    回调页会得到Code

    https://api.weixin.qq.com/sns/oauth2/access_token?appid=AppID&secret=AppSecret&code=Code&grant_type=authorization_code    

    获取access_token和openid,如果access_token有时间限制会过时,就去调用刷新接口(此处不描述可自行查看)

    第四步:

    获取用户相关信息

             
                

  • 相关阅读:
    bzoj3293 分金币
    考前模板整理
    CF785D Anton and School
    容斥法解决错排问题
    CF1248F Catowice City
    CF1248E Queue in the Train
    CF1244F Chips
    CF1244C The Football Season
    Noip2016Day1T2 天天爱跑步
    Noip2015Day2T3 运输计划
  • 原文地址:https://www.cnblogs.com/RainbowInTheSky/p/4720921.html
Copyright © 2011-2022 走看看