Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

访问统计功能报错 #43

Closed
wanghaoxi3000 opened this issue May 26, 2018 · 17 comments

Comments

Projects
None yet
6 participants
@wanghaoxi3000
Copy link

commented May 26, 2018

开启busuanzi或者leancloud的访问统计功能均会报错

开启busuanzi控制台报的错误

busuanzi.pure.mini.js:1 GET http://busuanzi.ibruce.info/busuanzi?jsonpCallback=BusuanziCallback_208781165297 net::ERR_ABORTED

image

开启leancloud控制台报的错误

Uncaught ReferenceError: AV is not defined
at (index):1

image

@cofess

This comment has been minimized.

Copy link
Owner

commented May 28, 2018

@wanghaoxi3000 统计功能先关了吧,可能有问题

@wanghaoxi3000

This comment has been minimized.

Copy link
Author

commented May 29, 2018

已经关掉了, 请问后续有修复计划吗?

@Huang-Jinxian

This comment has been minimized.

Copy link

commented Jul 3, 2018

遇到了一样的问题,统计功能无效2333

@zhaokuankuan

This comment has been minimized.

Copy link

commented Sep 18, 2018

@wanghaoxi3000 @Huang-Jinxian @wanghaoxi3000 @cofess 对于这个问题,我在上面给出了解决方案,你们可以看看! http://www.struggling-bird.cn/ 本人链接地址

@cofess

This comment has been minimized.

Copy link
Owner

commented Sep 26, 2018

@wanghaoxi3000 @Huang-Jinxian 更新一下不蒜子js就好了,http://ibruce.info/2015/04/04/busuanzi/

大家好,因七牛强制过期原有的『dn-lbstatics.qbox.me』域名(预计2018年10月初),与客服沟通数次无果,即使我提出为此付费也不行,只能更换域名到『busuanzi.ibruce.info』!因我是最早的一批七牛用户,为七牛至少带来了数百个邀请用户,很痛心,很无奈!各位继续使用不蒜子提供的服务,只需把原有的域名改一下即可,只需要修改该js域名,其他均未改变。

@liuzhihangs

This comment has been minimized.

Copy link

commented Sep 29, 2018

image

统计功能还是用不了.
@cofess

@liuzhihangs

This comment has been minimized.

Copy link

commented Sep 30, 2018

@inkss 可以的, 刚才试了下, 就是统计功能还是不能使用.

https://liuzhihang.com/

@cofess

This comment has been minimized.

Copy link
Owner

commented Oct 1, 2018

更新不蒜子js之后,统计功能应该可以使用,我博客统计正常
tim 20181001100109

@liuzhihangs

This comment has been minimized.

Copy link

commented Oct 3, 2018

@cofess 看到了, 你那边可以正常使用, 我这边是请求不过去.

image

@inkss

This comment has been minimized.

Copy link

commented Oct 3, 2018

@liuzhihangs 因为你的网站没有带 referrer 信息,不蒜子是根据这个信息确定文章的计数的。

head.ejs 文件中,作者 @cofess 为了豆瓣设置了 referrer=never

image


豆瓣的图片链接做了 防盗链,带来源信息的话就是 403 。

但是 @cofess 的网站 https://blog.cofess.com 并没有写这个(后续的更新都没有部署吧),所以 在火狐浏览器下图片依旧无法显示 ,反倒是谷歌浏览器,因为 no-referrer-when-downgrade 图片得以显示。


所以,也就是这句:

<meta name=referrer content=never>

放在 head 标签内太简单粗暴了,如果不使用豆瓣书单的话可以 直接把这句删掉,另外似乎 meta 放 body 也不是不可以吧。

@liuzhihangs

This comment has been minimized.

Copy link

commented Oct 3, 2018

@inkss @cofess 确实是这个原因, 我先关闭了

@cofess

This comment has been minimized.

Copy link
Owner

commented Oct 3, 2018

@liuzhihangs @inkss 可以删掉

<meta name=referrer content=never>

豆瓣可以找个代理,把 https://www.api.douban.com 换成 https://douban.uieee.com 即可

@liuzhihangs

This comment has been minimized.

Copy link

commented Oct 4, 2018

更新了主题之后, 发现书单图片不能正常显示. 书单和统计看来是有冲突
@cofess @inkss

@cofess cofess closed this Oct 4, 2018

@cofess

This comment has been minimized.

Copy link
Owner

commented Oct 4, 2018

@liuzhihangs 删除<meta name="referrer" content="never">这行代码,这行代码在head.js文件中,主题我昨天更新了一下,应该没问题
tim 20181004092550

@liuzhihangs

This comment has been minimized.

Copy link

commented Oct 4, 2018

@cofess 我是这么做了, 并且更新了, 但是更新之后书单 图片不能显示. 我又加上这个了, 虽然阅读量不能看, 但是豆瓣书图片可以正常显示. 你看下你的那边图片是否有本地缓存

@inkss

This comment has been minimized.

Copy link

commented Oct 4, 2018

有一个办法,meta 是可以放在 <body> 里的吧。

所以把 <meta name="referrer" content="never"> 放到 archive-book.ejs 的最前面。

然后在网页结构里就会是这个样子:

......
<head> </head>
<body class="main-center no-sidebar okayNav-loaded" ...>
  <header class="header" ...>
  <aside class="sidebar" ...>
  <main class="main" role="main">
    <meta name="referrer" content="never">
    <article class="article article-links article-type-list" ...>
......

在它之上的所有链接都会带来源信息,之后的就是 no-referrer 了。

所以理论上也就规避了豆瓣的防盗链了。

@cofess

This comment has been minimized.

Copy link
Owner

commented Oct 4, 2018

@liuzhihangs @inkss 之前是我本地有缓存,还以为问题解决了呢,现在好了,我在<meta name="referrer" content="never">上加了个判断,只在书单页面才会加上这段

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.