新增:记录页面访问量 API,并修复部分错误

This commit is contained in:
2022-11-27 23:01:12 +08:00
parent 7adc6dfb40
commit 0dc4afce07
3 changed files with 12 additions and 4 deletions

View File

@@ -82,7 +82,7 @@ const { author, authorLink, showPv, date, toDate, categories, tags, showCategory
if (data.showPv) {
// 记录并获取文章阅读数(使用文章标题 + 发布时间生成 MD5 值,作为文章的唯一标识)
onMounted(() => {
$api.getPv(md5(props.article.title + props.article.date), function(data) {
$api.getPv(md5(props.article.title + props.article.date), location.href, function(data) {
document.getElementById("pv").innerText = data
})
})