但行好事
莫论前程❤

解决百度分享不支持HTTPS问题

Google F12下发现报错如下:

Mixed Content: The page at "https://www.liupeng.mobi/archives/949" was loaded over HTTPS, but requested an insecure script "http://bdimg.share.baidu.com/static/api/js/share.js?cdnversion=424426" This request has been blocked; the content must be served over HTTPS.

点此下载static.zip,将解压(解压密码:themebetter)后得到的static文件夹上传到网站根目录(即:/var/www/html/static)。

最后一步:修改百度分享代码

完美快速解决百度分享不支持HTTPS的问题

删除百度分享代码中的以下网址

http://bdimg.share.baidu.com

修改后:

<div class="bdsharebuttonbox">
<span>分享到:</span>
<a class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a>
<a class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a>
<a class="bds_weixin" data-cmd="weixin" title="分享到微信"></a>
<a class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博"></a>
<a class="bds_sqq" data-cmd="sqq" title="分享到QQ好友"></a>
<a class="bds_bdhome" data-cmd="bdhome" title="分享到百度新首页"></a>
<a class="bds_tqf" data-cmd="tqf" title="分享到腾讯朋友"></a>
<a class="bds_youdao" data-cmd="youdao" title="分享到有道云笔记"></a>
<a class="bds_more" data-cmd="more">更多</a> <span>(</span><a class="bds_count" data-cmd="count" title="累计分享0次">0</a><span>)</span>
</div>
<script>
window._bd_share_config = {
    common: {
        "bdText"     : "",
        "bdMini"     : "2",
        "bdMiniList" : false,
        "bdPic"      : "",
        "bdStyle"    : "0",
        "bdSize"     : "24"
    },
    share: [{
        bdCustomStyle: "https://www.liupeng.mobi/wp-content/themes/dux/css/share.css"
    }]
}
with(document)0[(getElementsByTagName("head")[0]||body).appendChild(createElement("script")).src="/static/api/js/share.js?cdnversion="+~(-new Date()/36e5)];
</script>

꧁༺๑收工๑༻꧂

赞(1) 打赏
未经允许不得转载:刘鹏博客 » 解决百度分享不支持HTTPS问题
分享到: 更多 (0)

评论 抢沙发

评论前必须登录!

 

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏