node-weixin-menu
Menu apis for weixin
微信菜单API和命令行工具
微信菜单API是(node-weixin-api 或者 node-weixin-express)的一个子项目。 它提供:
- 菜单API共计4个(create, get, customize, remove)
- 命令行工具(wxmenu)
交流QQ群: 39287176
注:
node-weixin-express是基于node-weixin-*的服务器端参考实现。
node-weixin-api是基于node-weixin-*的API接口SDK。
它们都是由下列子项目组合而成:
-
node-weixin-config 用于微信配置信息的校验
-
node-weixin-auth 用于与微信服务器握手检验
-
node-weixin-util 一些常用的微信请求,加密,解密,检验的功能与处理
-
node-weixin-request 微信的各类服务的HTTP请求的抽象集合
-
node-weixin-oauth 微信OAuth相关的操作
-
node-weixin-pay 微信支付的服务器接口
-
node-weixin-jssdk 微信JSSDK相关的服务器接口
-
node-weixin-menu 微信菜单相关的操作与命令
安装
$ npm install --save node-weixin-menu
使用方法
在node代码中使用
var nodeWeixinMenu = ; var app = id: processenvAPP_ID secret: processenvAPP_SECRET token: processenvAPP_TOKEN; var auth = ;var config = ;configapp; var menu = "button": "type": "view" "name": "我要下单" "url": "http://www.soso.com/" "name": "菜单" "sub_button": "type": "view" "name": "搜索" "url": "http://www.soso.com/" "type": "view" "name": "视频" "url": "http://v.qq.com/" "type": "click" "name": "赞一下我们" "key": "V1001_GOOD" ; nodeWeixinMenu; nodeWeixinMenu; nodeWeixinMenu; nodeWeixinMenu;
在node命令行里使用
$ npm install --global node-weixin-menu $ wxmenu --help $#获取菜单$ wxmenu get --id WX_ID --secret WX_SECRET --token WX_TOKEN $#获取自定义菜单$ wxmenu customize --id WX_ID --secret WX_SECRET --token WX_TOKEN$#删除菜单$ wxmenu remove --id WX_ID --secret WX_SECRET --token WX_TOKEN$#创建菜单$ wxmenu create --id WX_ID --secret WX_SECRET --token WX_TOKEN --menu menu.json
注:使用时需要将WX_ID, WX_SECRET, WX_TOKEN,替换成你自己的真实参数
License
Apache-2.0 © calidion