微信上传图片ios不能调和Android能调上传接口的bug

版权声明:复制发表请附上原创博客地址 https://blog.csdn.net/weixin_41077029/article/details/84537033

问题描述:做微信公众号的时候发现iso不能显示,andriod里能正常调上传接口?

最后发现是url不一样

   // 微信config配置
    initConfig() {
      let _this = this;
      let url = "";
      // 判断是否是ios微信浏览器
      if (window.__wxjs_is_wkwebview === true) {
        url = this.$store.state.url.split("#")[0];
      } else {
        url = window.location.href.split("#")[0];
      }
      $ajax(
          "/getConfig",//获取配置信息的接口(后端给的)
          {url: url},  //传给后端的data
          "wexin"
        )
        .then(res => {
          // alert(JSON.stringify(res));
          _this.$wx.config({
            debug: false,
            appId: res.data.appid,
            timestamp: res.data.timestamp,
            nonceStr: res.data.nonceStr,
            signature: res.data.signature,
            jsApiList: [
              "chooseImage",
              "previewImage",
              "uploadImage",
              "downloadImage"
            ]
          });
        });
    },

猜你喜欢

转载自blog.csdn.net/weixin_41077029/article/details/84537033
今日推荐