@@ -230,13 +230,13 @@ public void customMessageSend(WxMpCustomMessage message) throws WxErrorException
230
230
}
231
231
232
232
public void menuCreate (WxMenu menu ) throws WxErrorException {
233
- if (menu .getMatchrule () != null ) {
234
- String url = "https://api.weixin.qq.com/cgi-bin/menu/addconditional" ;
235
- execute (new SimplePostRequestExecutor (), url , menu .toJson ());
236
- } else {
237
- String url = "https://api.weixin.qq.com/cgi-bin/menu/create" ;
238
- execute (new SimplePostRequestExecutor (), url , menu .toJson ());
239
- }
233
+ if (menu .getMatchrule () != null ) {
234
+ String url = "https://api.weixin.qq.com/cgi-bin/menu/addconditional" ;
235
+ execute (new SimplePostRequestExecutor (), url , menu .toJson ());
236
+ } else {
237
+ String url = "https://api.weixin.qq.com/cgi-bin/menu/create" ;
238
+ execute (new SimplePostRequestExecutor (), url , menu .toJson ());
239
+ }
240
240
}
241
241
242
242
public void menuDelete () throws WxErrorException {
@@ -245,7 +245,7 @@ public void menuDelete() throws WxErrorException {
245
245
}
246
246
247
247
public void menuDelete (String menuid ) throws WxErrorException {
248
- String url = "https://api.weixin.qq.com/cgi-bin/menu/delconditional" ;
248
+ String url = "https://api.weixin.qq.com/cgi-bin/menu/delconditional" ;
249
249
execute (new SimpleGetRequestExecutor (), url , "menuid=" + menuid );
250
250
}
251
251
@@ -264,11 +264,11 @@ public WxMenu menuGet() throws WxErrorException {
264
264
}
265
265
266
266
public WxMenu menuTryMatch (String userid ) throws WxErrorException {
267
- String url = "https://api.weixin.qq.com/cgi-bin/menu/trymatch" ;
268
- try {
269
- String resultContent = execute (new SimpleGetRequestExecutor (), url , "user_id=" + userid );
270
- return WxMenu .fromJson (resultContent );
271
- } catch (WxErrorException e ) {
267
+ String url = "https://api.weixin.qq.com/cgi-bin/menu/trymatch" ;
268
+ try {
269
+ String resultContent = execute (new SimpleGetRequestExecutor (), url , "user_id=" + userid );
270
+ return WxMenu .fromJson (resultContent );
271
+ } catch (WxErrorException e ) {
272
272
// 46003 不存在的菜单数据 46002 不存在的菜单版本
273
273
if (e .getError ().getErrorCode () == 46003 || e .getError ().getErrorCode () == 46002 ) {
274
274
return null ;
0 commit comments