黄舟2017-04-18 09:28:12
It turns out that I installed a program called weixinTest.java to modify the custom menu, but the main method does not execute automatically after the project is run. You need to manually click and run it to take effect.
WxTest.java------------------------------------------------- ----------------------------------
public class WxTest {
public static void main(String[] args) throws ParseException,IOException {
AccessToken token= WeChatUtil.getAccessToken();
//需要單獨運行創建或更新自定義 菜單
// if (token!=null&&token.getToken()!=null){
// System.out.println("Menu test-----");
// String menu= JSONObject.fromObject(WeChatUtil. initMenu()).toString();
// int result=WeChatUtil.createMenu(token.getToken(),menu);
// if (result==0){
// System.out.print("Create Menu successfuln");
// }else {
// System.out.print("Error code:"+result);
// }
// }
}
大家讲道理2017-04-18 09:28:12
When I used WeChat to test my account, my menu seemed to be written directly in a main function. Run it first, and then create the menu successfully. Start the server again.