From 72c9027d93c705c44cbfc67c5516de3123870987 Mon Sep 17 00:00:00 2001 From: AiHaibara <166741903+jyx04@users.noreply.github.com> Date: Fri, 21 Jun 2024 20:09:46 +0800 Subject: [PATCH] Update _worker.js --- _worker.js | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/_worker.js b/_worker.js index b3e3e11..f33fec9 100644 --- a/_worker.js +++ b/_worker.js @@ -336,6 +336,7 @@ if (url.pathname === '/backend-api/accounts/check') { }); } return response; +} //初始化信息填入功能 async function handleInitialRequest(request) { @@ -2667,25 +2668,6 @@ async function generateTableHTML(usersData, queryType) { `; } -function combineData(usersData, historyData) { - let combinedData = []; - let allUsers = new Set(usersData.map(u => u.user).concat(historyData.flatMap(h => h.usersData.map(u => u.user)))); - - allUsers.forEach(user => { - let historyUsage = historyData.map(h => { - let userUsage = h.usersData.find(u => u.user === user); - return userUsage ? { gpt4: userUsage.gpt4, gpt35: userUsage.gpt35 } : { gpt4: '', gpt35: '' }; - }); - let realTimeUsage = usersData.find(u => u.user === user); - combinedData.push({ - user, - historyUsage, - realTimeUsage: realTimeUsage ? { gpt4: realTimeUsage.gpt4, gpt35: realTimeUsage.gpt35 } : { gpt4: '', gpt35: '' } - }); - }); - - return combinedData; -} function generateHeaderRow(historyData) { return historyData.map(h => `GPT-4GPT-3.5`).join('');