配置微信公眾號菜單

配置微信公眾號菜單

找到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工具,如下,填寫紅框中的兩個參數(shù),點提交

https://coolaf.com/



第一個參數(shù),是請求的地址,其中access_token來自第二步

https://api.weixin.qq.com/cgi-bin/menu/create?access_token=36_2kNffukX5nKzdr-yWUPxN6AOzhIHcKiwUaUtNEVQE3ty8Gu7CNm87yWnIK4jYfSLIoUdXKqP3ZMwKfHpBq2ZUu28O55WYwv0Ir6U7x9DysGzYfm7oTto3QTxk6K5N-PGvtfTz1j3OhTcNpPrBCXhACAWXS

第二個參數(shù),是菜單的JSON,范例如下:

{

? "button": [

? ? {

? ? ? "name": "走進人大",

? ? ? "sub_button": [

? ? ? ? {

? ? ? ? ? "type": "view",

? ? ? ? ? "name": "人大概況",

? ? ? ? ? "url": "http://www.baidu.com"

? ? ? ? },

? ? ? ? {

? ? ? ? ? "type": "view",

? ? ? ? ? "name": "要聞動態(tài)",

? ? ? ? ? "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": "選民服務(wù)",

? ? ? "sub_button": [

? ? ? ? {

? ? ? ? ? "type": "view",

? ? ? ? ? "name": "代表連線",

? ? ? ? ? "url": "http://temp.rongzhiwang.com/custom/mobile/index.html#/pages/dblx/dblx"

? ? ? ? },

? ? ? ? {

? ? ? ? ? "type": "view",

? ? ? ? ? "name": "人大聯(lián)絡(luò)站",

? ? ? ? ? "url": "http://temp.rongzhiwang.com/custom/mobile/rdllz/rdllz.html"

? ? ? ? },

? ? ? ? {

? ? ? ? ? "type": "view",

? ? ? ? ? "name": "訴求回應(yīng)",

? ? ? ? ? "url": "http://temp.rongzhiwang.com/custom/mobile/index.html#/pages/sqhy/sqhy"

? ? ? ? }

? ? ? ]

? ? },

? ? {

? ? ? "name": "代表服務(wù)",

? ? ? "sub_button": [

? ? ? ? {

? ? ? ? ? "type": "view",

? ? ? ? ? "name": "代表履職",

? ? ? ? ? "url": "http://www.baidu.com"

? ? ? ? },

? ? ? ? {

? ? ? ? ? "type": "view",

? ? ? ? ? "name": "議案建議",

? ? ? ? ? "url": "http://www.baidu.com"

? ? ? ? },

? ? ? ? {

? ? ? ? ? "type": "view",

? ? ? ? ? "name": "民呼我應(yīng)",

? ? ? ? ? "url": "http://temp.rongzhiwang.com/custom/mobile/index.html#/pages/myhf/myhf"

? ? ? ? }

? ? ? ]

? ? }

? ]

}

點擊提交后,收到以下返回值,表示成功


效果


最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容