JSSDK 微信分享功能 IOS上fail link must be in js secure domain list报错?

IOS系统使用微信分享接口时候出现fail link must be in js secure domain list报错,在安卓实机上和微信开发工具上没有报错,路径上并没有中文字符,而且我还将路径后面的字符进行了转码也不行,不转码的时候也是不行的,安全域名为zhaodi.net.cn vue项目,微信相关代码如下

getWX_token() {
      this.$ajax({
        method: "post",
        url: "notice/get_token/",
        data: {
          url: encodeURIComponent(location.href.split("#")[0])
        }
      })
        .then(response => {
          console.log(response);
 
          this.wx_data = response.data;
          this.wxApi();
        })
        .catch(error => {
          Toast({
            message: "服务器出错,请尝试刷新"
          });
          console.log(error + "测试错误");
        });
    },
    wxApi() {
      let data = this.wx_data;
      let URIstring = this.$route.path;
      URIstring = URIstring.slice(12);
      console.log(URIstring);
      let option = {
        title: this.news.title,
        link: "http://zhaodi.net.cn:443/prevueinfo/" + encodeURIComponent(URIstring),
        imgUrl: "http://118.31.60.22/static/images/landimages/" + this.news.img,
        desc: this.news.desc
      };
      console.log(option.link);
      setTimeout(() => {
        wxapi.wxRegister(data, option);
      }, 400);
    }
const wxApi = {
    /**
     * [wxRegister 微信Api初始化]
     * @param  {Function} callback [ready回调函数]
     */
    wxRegister(data, option) { //data是微信配置信息,option是分享的配置内容
        wx.config({
            debug: true, // 开启调试模式
            appId: data.app_id, // 必填,公众号的唯一标识
            timestamp: data.timestamp, // 必填,生成签名的时间戳
            nonceStr: data.noncestr, // 必填,生成签名的随机串
            signature: data.signature, // 必填,签名,见附录1
            jsApiList: [
                'checkJsApi',
                'updateTimelineShareData',
                'updateAppMessageShareData',
                'onMenuShareQQ',
                'onMenuShareWeibo'
            ] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
        })
        wx.ready(function () {
            wx.updateTimelineShareData({
                title: option.title, // 分享标题
                link: option.link, // 分享链接
                imgUrl: option.imgUrl, // 分享图标
                desc: option.desc, // 分享描述
                success() {
                    // 用户成功分享后执行的回调函数
                    alert(option.title)
                    option.success()
                },
                cancel() {
                    // 用户取消分享后执行的回调函数
                    option.error()
                }
            });
            wx.updateAppMessageShareData({
                title: option.title, // 分享标题
                desc: option.desc, // 分享描述
                link: option.link, // 分享链接
                imgUrl: option.imgUrl, // 分享图标
                success() {
                    // 用户成功分享后执行的回调函数
                    alert(option.title)
                    option.success()
                },
                cancel() {
                    // 用户取消分享后执行的回调函数
                    option.error()
                }
            })
        })
    }
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值