This commit is contained in:
hicccc77
2026-03-14 18:58:55 +08:00
11 changed files with 114 additions and 51 deletions

View File

@@ -988,6 +988,17 @@ function registerIpcHandlers() {
}
})
ipcMain.handle('log:clear', async () => {
try {
const logPath = join(app.getPath('userData'), 'logs', 'wcdb.log')
await mkdir(dirname(logPath), { recursive: true })
await writeFile(logPath, '', 'utf8')
return { success: true }
} catch (e) {
return { success: false, error: String(e) }
}
})
ipcMain.handle('diagnostics:getExportCardLogs', async (_, options?: { limit?: number }) => {
return exportCardDiagnosticsService.snapshot(options?.limit)
})