微信公众号开发
1.申请一个测试公众号
(1)获取access_token get方法
https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=。。。&secret=。。。
返回值为如下:
获取access_token返回值(2)创建菜单 post方法
https://api.weixin.qq.com/cgi-bin/menu/create?access_token=30_XwAZFsNYEjHv-5aQ_Hu6n5MocvDOOA-gjfz8uQnBnvjWcCXDpqjiUK_WBZwdJ-sevZyGGDKQwhN4jXyVP1Vs2E1LPrkNIl8pUOBA2LffNPMwtPS7QJKa0g7ID_mcHet41l6f3DIhY-4KguudEYPhAEAJDU
输入参数
参数{
"button": [
{
"name": "最新疫情",
"type": "view",
"url": "http://n.sw.jpsycn.com/"
},
{
"name": "我的收藏",
"sub_button": [
{
"name": "CSDN",
"type": "view",
"url": "https://blog.csdn.net/weixin_46266914"
},
{
"name": "简书",
"type": "view",
"url": "https://www.jianshu.com/u/5457e74705e2"
}
]
},
{
"key": "text",
"name": "回复图文",
"type": "click"
}
]
}
返回值
返回值(3)微信授权登录
https://blog.csdn.net/qq_37130983/article/details/88372936
获取code拼接的链接,需要在微信中打开
https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx1c20914adcca84ee&redirect_uri=http://anhua1234567.oicp.io/callBack&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect
喜欢请关注 “蛋皮皮” 微信公众号!更多干货等你来学习哦。