很多站长发现,Discuz全站配置SSL证书域名头http变成https以后,帖子或文章的分享功能失效了。
百度分享之所以不支持 https是因为加载的 static资源来自http请求,
那么今天兔源码站长就为大家分享一下解决这个问题的方法
解决方法也很简单,只要把分享代码全部拿出来放到自己的网站根目录即可,
首先下载源码,将解压(解压密码:tuyuanma)后得到的static文件夹上传到网站根目录(注:域名/static)
static.zip
(291.1 KB, 下载次数: 138)
然后将你模板页面中分享代码里的百度网址去掉,http://bdimg.share.baidu.com 路径去掉
举例2个分享代码:- //百度分享
- window._bd_share_config = {
- "common": {
- "bdSnsKey": {},
- "bdText": "",
- "bdMini": "2",
- "bdMiniList": false,
- "bdPic": "",
- "bdStyle": "0",
- "bdSize": "16"
- }, "slide": {"type": "slide", "bdImg": "6", "bdPos": "left", "bdTop": "100"}
- };
- with (document)0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).
- src = '/static/api/js/share.js?v=89860593.js?CDNversion=' + ~(-new Date() / 36e5)];
复制代码- <script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{"bdSize":16}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
复制代码 |