修复:修复我的归档、我的标签页面查询文章阅读数不回显的问题(并优化了记录页面浏览量 API 的调用方式)

This commit is contained in:
2022-11-28 00:13:59 +08:00
parent 0dc4afce07
commit c5a1dd5183
3 changed files with 16 additions and 9 deletions

View File

@@ -28,10 +28,16 @@ export const head: HeadConfig[] = [
})();`],
// 页面访问量统计
['script', {}, `var pageUrl = location.href;
(function() {
xhr = new XMLHttpRequest();
xhr.open('GET', 'https://api.charles7c.top/blog/pv?pageUrl=' + pageUrl);
xhr.send();
})();`]
/*['script', {}, `var pageUrl = location.href;
(function() {
var pv = document.createElement("script");
pv.src = "https://api.charles7c.top/blog/pv?pageUrl=" + pageUrl;
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(pv, s);
})();`],
})();`]*/
]