收藏
回答

更新自定义菜单 API 返回 “不合法的子菜单按钮 URL 长度”,我的 URL 确实没有超长啊 !

微信官方文档:https://developers.weixin.qq.com/doc/offiaccount/Custom_Menus/Creating_Custom-Defined_Menu.html

更新菜单时的原始报文(敏感字段已处理):

 {
  "button": [
    {
      "type": "view",
      "name": "激活会员",
      "url": "https://abcdefgh.abcdefghij.cn/wx/member/activation?abc=abcdefghi"
    },
    {
      "name": "活动入口",
      "sub_button": [
        {
          "type": "miniprogram",
          "name": "邀请有礼",
          "appid": "xxx",
          "pagepath": "pages/market/invite/inviteHome"
        },
        {
          "type": "miniprogram",
          "name": "礼品卡",
          "appid": "xxx",
          "pagepath": "pages/index/index"
        },
        {
          "type": "miniprogram",
          "name": "小程序",
          "appid": "xxx",
          "pagepath": "pages/index/index"
        },
        {
          "type": "view",
          "name": "测试",
          "url": "https://jpostest.wangdian.cn/"
        }
      ]
    },
    {
      "name": "个人中心",
      "sub_button": [
        {
          "type": "miniprogram",
          "name": "会员中心",
          "appid": "xxx",
          "pagepath": "pages/home/homeMain"
        },
        {
          "type": "miniprogram",
          "name": "我的积分",
          "appid": "xxx",
          "pagepath": "pages/score/myScore"
        },
        {
          "type": "miniprogram",
          "name": "优惠券",
          "appid": "xxx",
          "pagepath": "pages/home/homeMain?page_name=homeCoupon"
        },
        {
          "type": "miniprogram",
          "name": "会员资料",
          "appid": "xxx",
          "pagepath": "pages/member/memberInfo/memberInfo"
        },
        {
          "type": "miniprogram",
          "name": "会员特权",
          "appid": "xxx",
          "pagepath": "pages/member/memberPrivilege/memberPrivilege"
        }
      ]
    }
  ]
}
回答关注问题邀请回答
收藏

1 个回答

  • 涛小涛🌲
    涛小涛🌲
    2020-02-12
     {
              "type": "miniprogram",
              "name": "小程序",
              "appid": "xxx",
              "pagepath": "pages/index/index"
            },
    这种的要加上url,
    {
              "type": "miniprogram",
              "name": "小程序",
              "appid": "xxx",
              "pagepath": "pages/index/index",
              "url": "http://www.baidu.com"
      
            }
    
    2020-02-12
    有用
    回复 1
    •  
       
      01-31
      那这种的呢   这个url没有超过10247个字节
      01-31
      回复
登录 后发表内容
问题标签