From 80b32192449271401681d51f8abf20be1313e0bf Mon Sep 17 00:00:00 2001 From: satori Date: Mon, 16 Dec 2024 12:08:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E6=90=9C=E7=B4=A2=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/main.js b/main.js index a79107a..041ca19 100644 --- a/main.js +++ b/main.js @@ -193,15 +193,14 @@ export function main() { const url = decodeURI(item.request.uri) const regex = /text:"([^"]*)"/g const match = regex.exec(url) || [] - match.map(item => item[1]).forEach(item => { - 截图.搜索词.日.set(item, (截图.搜索词.日.get(item) || 0) + 1) - 截图.搜索词.周.set(item, (截图.搜索词.周.get(item) || 0) + 1) - 截图.搜索词.月.set(item, (截图.搜索词.月.get(item) || 0) + 1) - 截图.搜索词.年.set(item, (截图.搜索词.年.get(item) || 0) + 1) - 截图.搜索词.总.set(item, (截图.搜索词.总.get(item) || 0) + 1) - }) - console.log(match) - console.log(match[1]) + if (match) { + let key = match[1] + 截图.搜索词.日.set(key, (截图.搜索词.日.get(key) || 0) + 1) + 截图.搜索词.周.set(key, (截图.搜索词.周.get(key) || 0) + 1) + 截图.搜索词.月.set(key, (截图.搜索词.月.get(key) || 0) + 1) + 截图.搜索词.年.set(key, (截图.搜索词.年.get(key) || 0) + 1) + 截图.搜索词.总.set(key, (截图.搜索词.总.get(key) || 0) + 1) + } return } })