weixin4j-mp:新增个性化菜单接口 & 其他优化
This commit is contained in:
@@ -58,7 +58,7 @@ public class MenuApi extends MpApi {
|
||||
private JsonResult createMenu0(String url, JSONObject data)
|
||||
throws WeixinException {
|
||||
WeixinResponse response = weixinExecutor.post(
|
||||
String.format(url, tokenHolder.getAccessToken()),
|
||||
String.format(url, "h5hb64iP9mBzt0rK6DW1OuOpE066F6iQXmHUqJ83fxTHkDaA0tNOjMMuUrWGwAves4Vi5bfwPKdp3IVhCsZCOHhsX74GXnrTtMg_oFPgiUwSXEhAIABGN"),
|
||||
JSON.toJSONString(data, new NameFilter() {
|
||||
@Override
|
||||
public String process(Object object, String name,
|
||||
|
||||
@@ -10,12 +10,15 @@ package com.foxinmy.weixin4j.mp.type;
|
||||
* @see
|
||||
*/
|
||||
public final class URLConsts {
|
||||
public static final String BASE_URL = "https://api.weixin.qq.com/cgi-bin";
|
||||
/**
|
||||
* 公众平台获取token的url
|
||||
*/
|
||||
public static final String ASSESS_TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s";
|
||||
public static final String ASSESS_TOKEN_URL = BASE_URL
|
||||
+ "/token?grant_type=client_credential&appid=%s&secret=%s";
|
||||
/**
|
||||
* 公众平台jssdk获取token的url
|
||||
*/
|
||||
public static final String JS_TICKET_URL = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=%s&type=jsapi";
|
||||
public static final String JS_TICKET_URL = BASE_URL
|
||||
+ "/ticket/getticket?access_token=%s&type=jsapi";
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ public class MenuTest extends TokenTest {
|
||||
"小哥介绍",
|
||||
"http://mp.weixin.qq.com/s?__biz=MzI2MTA5OTM4OQ==&mid=400990970&idx=1&sn=5c7fd72e782c49f7c933b91c63eddc80#rd",
|
||||
ButtonType.view));
|
||||
button.pushSub(new Button("兴趣部落", "http://buluo.qq.com/p/barindex.html?from=share&bid=282651", ButtonType.view));
|
||||
button.pushSub(new Button("服务流程", "FLOW", ButtonType.click));
|
||||
button.pushSub(new Button("在线客服", "KF", ButtonType.click));
|
||||
buttons.add(button);
|
||||
|
||||
Reference in New Issue
Block a user