/**
* 公众号小程序菜单配置
*/
public static void main(String[] args) throws Exception {
StringBuffer s = new StringBuffer();
s.append(" {\"button\":[");
s.append("{");
s.append("\"type\":\"miniprogram\",");
s.append("\"name\":\"xxx\",");
s.append("\"url\":\"http://mp.weixin.qq.com\",");
s.append("\"appid\":\"小程序appid\",");
s.append("\"pagepath\":\"pages/login/login\"");//小程序首页
s.append("}").append("]}");
System.out.println(s.toString());
//获取全局AccessToken
Map<String, String> map = weixinutils.getAccessToken("微信公众号appid", "微信公众号密钥");
//创建菜单
String res = weixinutils.createMenu(s.toString(), (String)map.get("access_token"));
System.out.println(res);
}