This commit is contained in:
2024-12-16 06:31:10 +08:00
parent d0602c4bcf
commit d5648e7636

12
main.js
View File

@@ -71,9 +71,9 @@ export default function () {
setInterval(() => {
存档('每10分钟自动存档...')
update('web_images', 'day_rank', Object.entries(Object.fromEntries(screenshots)))
update('web_article', 'day_rank', Object.entries(Object.fromEntries(articles)))
//update('web_member_explorer', 'day_rank', Object.entries(Object.fromEntries(collections)))
update('web_images', 'day_rank', Object.entries(Object.fromEntries(截图.浏览数.)))
update('web_article', 'day_rank', Object.entries(Object.fromEntries(文章.浏览数.)))
//update('web_member_explorer', 'day_rank', Object.entries(Object.fromEntries(收藏.浏览数.日)))
}, 600000)
// 实时读取日志文件
@@ -97,7 +97,7 @@ export default function () {
if (item.request.uri.startsWith('/web/v1/article/get')) {
const [uri, id] = item.request.uri.match(articleRegex) ?? []
if (uri && id) {
articles.set(id, articles.has(id) ? articles.get(id) + 1 : 1)
文章.浏览数..set(id, 文章.浏览数..has(id) ? 文章.浏览数..get(id) + 1 : 1)
}
}
@@ -105,7 +105,7 @@ export default function () {
if (item.request.uri.startsWith('/web/v1/images/detail/v2')) {
const [uri, id] = item.request.uri.match(imagesRegex) ?? []
if (uri && id) {
screenshots.set(id, screenshots.has(id) ? screenshots.get(id) + 1 : 1)
截图.浏览数..set(id, 截图.浏览数..has(id) ? 截图.浏览数..get(id) + 1 : 1)
}
return
}
@@ -114,7 +114,7 @@ export default function () {
if (item.request.uri.startsWith('/web/v1/member/explorer/article/get')) {
const [uri, id] = item.request.uri.match(collectionRegex) ?? []
if (uri && id) {
collections.set(id, collections.has(id) ? collections.get(id) + 1 : 1)
收藏.浏览数..set(id, 收藏.浏览数..has(id) ? 收藏.浏览数..get(id) + 1 : 1)
}
return
}