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 } })