Procházet zdrojové kódy

change tab space

change tab space 1 time
master
tianmu před 9 roky
rodič
revize
b2e1cca6c2
1 změnil soubory, kde provedl 13 přidání a 13 odebrání
  1. +13
    -13
      weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpServiceImpl.java

+ 13
- 13
weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/WxMpServiceImpl.java Zobrazit soubor

@@ -230,13 +230,13 @@ public class WxMpServiceImpl implements WxMpService {
}

public void menuCreate(WxMenu menu) throws WxErrorException {
if (menu.getMatchrule() != null) {
String url = "https://api.weixin.qq.com/cgi-bin/menu/addconditional";
execute(new SimplePostRequestExecutor(), url, menu.toJson());
} else {
String url = "https://api.weixin.qq.com/cgi-bin/menu/create";
execute(new SimplePostRequestExecutor(), url, menu.toJson());
}
if (menu.getMatchrule() != null) {
String url = "https://api.weixin.qq.com/cgi-bin/menu/addconditional";
execute(new SimplePostRequestExecutor(), url, menu.toJson());
} else {
String url = "https://api.weixin.qq.com/cgi-bin/menu/create";
execute(new SimplePostRequestExecutor(), url, menu.toJson());
}
}

public void menuDelete() throws WxErrorException {
@@ -245,7 +245,7 @@ public class WxMpServiceImpl implements WxMpService {
}
public void menuDelete(String menuid) throws WxErrorException {
String url = "https://api.weixin.qq.com/cgi-bin/menu/delconditional";
String url = "https://api.weixin.qq.com/cgi-bin/menu/delconditional";
execute(new SimpleGetRequestExecutor(), url, "menuid=" + menuid);
}

@@ -264,11 +264,11 @@ public class WxMpServiceImpl implements WxMpService {
}
public WxMenu menuTryMatch(String userid) throws WxErrorException {
String url = "https://api.weixin.qq.com/cgi-bin/menu/trymatch";
try {
String resultContent = execute(new SimpleGetRequestExecutor(), url, "user_id=" + userid);
return WxMenu.fromJson(resultContent);
} catch (WxErrorException e) {
String url = "https://api.weixin.qq.com/cgi-bin/menu/trymatch";
try {
String resultContent = execute(new SimpleGetRequestExecutor(), url, "user_id=" + userid);
return WxMenu.fromJson(resultContent);
} catch (WxErrorException e) {
// 46003 不存在的菜单数据 46002 不存在的菜单版本
if (e.getError().getErrorCode() == 46003 || e.getError().getErrorCode() == 46002) {
return null;


Načítá se…
Zrušit
Uložit