From eb2e0e5d2ae2b5382c0339bb37e45ac04cff4ee7 Mon Sep 17 00:00:00 2001 From: satori Date: Mon, 16 Dec 2024 11:42:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=BD=93=E6=97=A5=E7=83=AD?= =?UTF-8?q?=E9=97=A8=E6=90=9C=E7=B4=A2=E8=AF=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.js b/main.js index 724418f..71b563c 100644 --- a/main.js +++ b/main.js @@ -37,8 +37,8 @@ export function get_views(name, ids = []) { export function get_search(n = 10) { const ex = new Map() const all = { 文章, 作品, 游戏, 截图, 收藏, 综合 } - for (const item of all) { - item.搜索词.forEach((value, key) => { + for (const key in all) { + all[key].搜索词.forEach((value, key) => { ex.set(key, (ex.get(key) || 0) + value) }) } @@ -155,7 +155,7 @@ export function main() { 文章.浏览数.周.set(id, (文章.浏览数.周.get(id) || 0) + 1) 文章.浏览数.月.set(id, (文章.浏览数.月.get(id) || 0) + 1) 文章.浏览数.年.set(id, (文章.浏览数.年.get(id) || 0) + 1) - 文章.浏览数.总.set(id, (文章.浏览数.总.get(id) || 0) + 1) + 文章.浏览数.总.set(id, (文章.浏览数.总.get(id) || 0) + 1) } }