鍍金池/ 問答/HTML5  C++  HTML/ vue用百度分享不支持https,但是網(wǎng)上的解決方法會報錯

vue用百度分享不支持https,但是網(wǎng)上的解決方法會報錯

用的網(wǎng)上的解決方法是,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里配置的通用頭部,不知道它怎么就加上里
回答
編輯回答
紓惘

這明顯是找不到share.js這個文件,你代碼下載下來放的路徑是啥

2017年12月30日 08:38