From 5f127098cf8ce9f83336e3ed06cef2118b305818 Mon Sep 17 00:00:00 2001 From: satori Date: Mon, 16 Dec 2024 12:03:32 +0800 Subject: [PATCH] DEBUG --- main.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.js b/main.js index a98c9fd..8c7d250 100644 --- a/main.js +++ b/main.js @@ -35,14 +35,15 @@ export function get_views(name, ids = []) { // 获取当日热门搜索词 export function get_search(n = 10) { - const ex = new Map() + const 全部 = new Map() const all = { 文章, 作品, 游戏, 截图, 收藏, 综合 } for (const key in all) { all[key].搜索词.日.forEach((value, key) => { - ex.set(key, (ex.get(key) || 0) + value) + console.log(key, value) + 全部.set(key, (全部.get(key) || 0) + value) }) } - return [...ex.entries()].sort((a, b) => b[1] - a[1]).slice(0, n).map(([text, count]) => { + return [...全部.entries()].sort((a, b) => b[1] - a[1]).slice(0, n).map(([text, count]) => { return { text, count } }) }