export csv format & log title debounce (#3754)

This commit is contained in:
heheer
2025-02-11 17:36:00 +08:00
committed by GitHub
parent 8ac6494e60
commit f5d045eece
3 changed files with 16 additions and 6 deletions

View File

@@ -229,7 +229,7 @@ async function handler(req: ApiRequestProps<ExportChatLogsBody, {}>, res: NextAp
);
let chatDetailsStr = '';
try {
chatDetailsStr = JSON.stringify(chatDetails);
chatDetailsStr = JSON.stringify(chatDetails).replace(/"/g, '""').replace(/\n/g, '\\n');
} catch (e) {
addLog.error(`export chat logs error`, e);
}
@@ -252,6 +252,6 @@ async function handler(req: ApiRequestProps<ExportChatLogsBody, {}>, res: NextAp
}
export default NextAPI(
useIPFrequencyLimit({ id: 'export-chat-logs', seconds: 2, limit: 1, force: true }),
useIPFrequencyLimit({ id: 'export-chat-logs', seconds: 60, limit: 1, force: true }),
handler
);