前期工作
static 解压后丢到站点的根目录,这里需要确保根目录
能被访问到,即你的域名可访问目录,然后对应的百度分享代码中,把http://bdimg.share.baidu.com/
改为/
,就是说让系统自动去补全访问目录,前期工作就是这样了
示例代码
<!— 百度分享start —>
<script>
window._bd_share_config = {
common: {
"bdText" : "",
"bdMini" : "2",
"bdMiniList" : false,
"bdPic" : "",
"bdStyle" : "0",
"bdSize" : "24"
},
share: [{
bdCustomStyle: "/public/css/share.css"
}]
}
with(document)0[(getElementsByTagName("head")[0]||body).appendChild(createElement("script")).src="/static/api/js/share.js?cdnversion="+~(-new Date()/36e5)];
</script>
<!— 百度分享end —>
下载地址
文件原址:https://github.com/hrwhisper/baiduShare
下载链接:https://pan.baidu.com/s/1TmyZ1DUAz6h1G0sf7Kw2PA 密码:gs17
参考文档:https://www.hrwhisper.me/baidu-share-not-support-https-solution/
评论 (0)