@@ -230,13 +230,13 @@ public void customMessageSend(WxMpCustomMessage message) throws WxErrorException
230230 }
231231
232232 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+ }
240240 }
241241
242242 public void menuDelete () throws WxErrorException {
@@ -245,7 +245,7 @@ public void menuDelete() throws WxErrorException {
245245 }
246246
247247 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" ;
249249 execute (new SimpleGetRequestExecutor (), url , "menuid=" + menuid );
250250 }
251251
@@ -264,11 +264,11 @@ public WxMenu menuGet() throws WxErrorException {
264264 }
265265
266266 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 ) {
272272 // 46003 不存在的菜单数据 46002 不存在的菜单版本
273273 if (e .getError ().getErrorCode () == 46003 || e .getError ().getErrorCode () == 46002 ) {
274274 return null ;
0 commit comments