配置微信公众号菜单
找到appId和secret
http://mp.weixin.qq.com/debug/cgi-bin/sandboxinfo?action=showinfo&t=sandbox/index
登录后

获取token
浏览器中敲入下面地址,注意appId和secret来源于第一步
https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=XXXXXX&secret=XXXXXXX
敲完后可以看到

修改菜单
打开一个在线post工具,如下,填写红框中的两个参数,点提交
https://coolaf.com/

第一个参数,是请求的地址,其中access_token来自第二步
第二个参数,是菜单的JSON,范例如下:
{
"button": [
{
"name": "走进人大",
"sub_button": [
{
"type": "view",
"name": "人大概况",
"url": "http://www.baidu.com"
},
{
"type": "view",
"name": "要闻动态",
"url": "http://www.baidu.com"
},
{
"type": "view",
"name": "通知通告",
"url": "http://www.baidu.com"
},
{
"type": "view",
"name": "人事任免",
"url": "http://www.baidu.com"
},
{
"type": "view",
"name": "人大课堂",
"url": "http://www.baidu.com"
}
]
},
{
"name": "选民服务",
"sub_button": [
{
"type": "view",
"name": "代表连线",
"url": "http://temp.rongzhiwang.com/custom/mobile/index.html#/pages/dblx/dblx"
},
{
"type": "view",
"name": "人大联络站",
"url": "http://temp.rongzhiwang.com/custom/mobile/rdllz/rdllz.html"
},
{
"type": "view",
"name": "诉求回应",
"url": "http://temp.rongzhiwang.com/custom/mobile/index.html#/pages/sqhy/sqhy"
}
]
},
{
"name": "代表服务",
"sub_button": [
{
"type": "view",
"name": "代表履职",
"url": "http://www.baidu.com"
},
{
"type": "view",
"name": "议案建议",
"url": "http://www.baidu.com"
},
{
"type": "view",
"name": "民呼我应",
"url": "http://temp.rongzhiwang.com/custom/mobile/index.html#/pages/myhf/myhf"
}
]
}
]
}
点击提交后,收到以下返回值,表示成功

效果
