百度分享不支持Https的解决方案
侧边栏壁纸
  • 累计撰写 114 篇文章
  • 累计收到 22 条评论

百度分享不支持Https的解决方案

SanLiLin
2019-02-27 / 0 评论 / 597 阅读 / 正在检测是否收录...
温馨提示:
本文最后更新于2019年03月13日,已超过1547天没有更新,若内容或图片失效,请留言反馈。

前期工作

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

评论 (0)

取消