vue用百度分享不支持https,但是网上的解决方法会报错

用的网上的解决方法是,Github地址:https://github.com/hrwhisper/...
把这个克隆到本地放在了文件里,并且在代码中引入,但是报错了

if (!this.hasBaidu) {
                this.hasBaidu = true;
                window._bd_share_config = {
                    common: {
                        bdText: document.title,
                        bdUrl: window.location.href,
                    },
                    share: [{
                        tag: "share_0",
                        bdSize: 24
                    }],
                };
                const s = document.createElement('script');
                s.type = 'text/javascript';
              
下面代码是修改后的

s.src = '/../../static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5);

                document.body.appendChild(s);
            }
            

点击后报错_id.vue?64e7:349 GET http://127.0.0.1:3000/static/api/js/share.js?v=89860593.js?cdnversion=424185 404 (OK)

http://127.0.0.1:3000,这个是vue里配置的通用头部,不知道它怎么就加上里
阅读 1.9k
1 个回答

这明显是找不到share.js这个文件,你代码下载下来放的路径是啥

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题