百度 share 不支持 https 问题真是头疼,好在百度站长已经支持了哦。
原理
将百度 share 用到的所有 js、css 等文件 down 下来,放在 https 的站点里。我才用的方法是将上述文件放到七牛 CDN 中。
baidu share 库
参考https://github.com/xiexianbin/baidu-share-https,将代码放到站点根目录下,或CDN里:
static\api\js\share.js
domain: {staticUrl: "http://bdimg.share.baidu.com/"}
修改为:
domain: {staticUrl: "/"}
或:
domain: {staticUrl: "https://cn-cdn.xiexianbin.cn/"}