avatar

目录
基于leancloud的文章访客统计修复

背景

在折腾添加leancloud的文章访客统计时,在站点页面显示为Counter not initialized! See more at console err msg.查阅资料寻得解决方案
Leancloud访客统计插件重大安全漏洞修复指南一文中已经给出了解决方案。只要按照步骤走,基本没有问题。

我出现的问题

1. 缺失regenerator以及babel-runtime模块

在执行到这一步时没有问题

bash
1
npm install hexo-leancloud-counter-security --save

但这一步时提示我有缺失模块regenerator以及babel-runtime

bash
1
hexo lc-counter register <<username>> <<password>>

bash
1
hexo lc-counter r <<username>> <<password>>

2. valine评论与文章访客统计相冲突

解决方法

1. 解决缺失regenerator以及babel-runtime模块

在博客根目录下执行这两个命令即可

bash
1
2
npm install regenerator --save
npm install babel-runtime --save

之后按照参考资料:Leancloud访客统计插件重大安全漏洞修复指南 完成就没事了

2. 解决valine评论与文章访客统计相冲突

在leancloud中注册创建一个新应用,让valine评论与文章访客统计为两个不相干的应用即可

文章作者: 阿长啊
文章链接: https://www.52chang.wang/post/aecd2f31.html
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 长弓不是弓长
打赏
  • 微信
    微信
  • 支付宝
    支付宝

评论