站点自从开启 https 之后 ,百度分享就不能用了!但是又寻找不到类似百度分享的替代品。。
怎么办呢?要如何解决 百度分享不支持https的问题呢,
跟着博主动动手,让你百度分享仍然能在https下使用 ~
伸手党
先上伸手党的解决方案~
博主修改好的分享代码(下面两个链接下载其中一个)的即可
- Github地址(推荐,2016.10.2更新):https://github.com/hrwhisper/baiduShare
下载方式如下:
static 解压后丢到站点根目录下即可。
然后对应的百度分享代码中,把http://bdimg.share.baidu.com/改为 /
.src=‘http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=’+~(–new Date()/36e5)]; 改为 .src=’/static/api/js/share.js?v=89860593.js?cdnversion=’+~(-new Date()/36e5)];