修复:修复我的归档、我的标签页面查询文章阅读数不回显的问题(并优化了记录页面浏览量 API 的调用方式)
This commit is contained in:
@@ -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);
|
||||
})();`],
|
||||
})();`]*/
|
||||
]
|
@@ -47,7 +47,7 @@ export const themeConfig: DefaultTheme.Config = {
|
||||
articleMetadataConfig: {
|
||||
author: '查尔斯', // 文章全局默认作者名称
|
||||
authorLink: '/about/me', // 点击作者名时默认跳转的链接
|
||||
showPv: true // 是否显示文章阅读数, 需要在 docs/.vitepress/theme/api/config.js 及 interface.js 配置好相应 API 接口
|
||||
showViewCount: true // 是否显示文章阅读数, 需要在 docs/.vitepress/theme/api/config.js 及 interface.js 配置好相应 API 接口
|
||||
},
|
||||
// 自定义扩展: 文章版权配置
|
||||
copyrightConfig: {
|
||||
|
Reference in New Issue
Block a user