• 微信公众号添加菜单跳转到小程序的40166错误码解决方案


    {"errcode":40166,"errmsg":"invalid weapp appid hint: [evMVGa07191892]"}

    首先看微信公众号和微信小程序是否关联

    其次再看自定义添加菜单中添加小程序的appid是不是原始id,如果是原始id的话要在小程序后台查看小程序id

    然后检查以上都没问题,因为包的异常是与appid有关的,所以再看创建的自定义菜单给微信返回的json里面是否有appid

    一看是这样的

    {"button":[{"type":"click","name":"一级","sub_button":[{"type":"miniprogram","name":"小程序","url":"http://www.baidu.com"}]},{"type":"miniprogram","name":"一级2","url":"https:/www.baidu.com"},{"type":"click","name":"一级3","sub_button":[{"type":"miniprogram","name":"小程序","url":"https://www.baidu.com"}]}]}

    这样显然不行啊

    https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141013

    文档里说得清清楚楚明明白白,要是miniprogram类型的话要传appid、pagepath

    所以检查一下是哪里没有赋值,赋值就可以了呀

    一步一步检查,重点检查下WxMenuGsonAdapter

    {"button":[{"type":"click","name":"一级","sub_button":[{"type":"miniprogram","name":"小程序","url":"http://www.baidu.com","appid":"this is your appid","pagepath":"pages/index/index"}]},{"type":"miniprogram","name":"一级2","url":"https:/www.baidu.com","appid":"this is your appid","pagepath":"pages/index/index"},{"type":"click","name":"一级3","sub_button":[{"type":"miniprogram","name":"小程序","url":"https://www.baidu.com","appid":"this is your appid","pagepath":"pages/index/index"}]}]}

    (上面的appid要是小程序的appid而不是原始id,在小程序后台查看就可以了)

  • 相关阅读:
    在购物过程中的购买用请求重定向不用转发的原因
    自己在WEB学习过程中遇到的问题
    WEB应用中普通java代码如何读取资源文件
    [课堂总结]C++课堂总结(二)
    [一些问题] ubuntu 18.04下 配置qt opencv的坑
    [学习笔记] Ubuntu下编译C++ OpenCV程序并运行
    [学习笔记] cv2.Canny 边缘检测
    [C++讨论课] 课堂记录(一)
    [R] 简单笔记(一)
    Appium入门示例(Java)
  • 原文地址:https://www.cnblogs.com/xsl1995/p/10531529.html
Copyright © 2020-2023  润新知