Home  >  Q&A  >  body text

java - 微信自定义菜单链接问题

巴扎黑巴扎黑2712 days ago426

reply all(3)I'll reply

  • 黄舟

    黄舟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);
    // }
    // }
    }

    reply
    0
  • 阿神

    阿神2017-04-18 09:28:12

    You need to wait 24 hours or re-follow WeChat after updating the menu

    reply
    0
  • 大家讲道理

    大家讲道理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.

    reply
    0
  • Cancelreply