修复html导出问题

This commit is contained in:
xuncha
2026-03-20 14:57:45 +08:00
parent 816770d407
commit 3fabf961e5
2 changed files with 11 additions and 1 deletions

View File

@@ -688,8 +688,16 @@ export class ConfigService {
} }
} }
private getUserDataPath(): string {
const workerUserDataPath = String(process.env.WEFLOW_USER_DATA_PATH || process.env.WEFLOW_CONFIG_CWD || '').trim()
if (workerUserDataPath) {
return workerUserDataPath
}
return app?.getPath?.('userData') || process.cwd()
}
getCacheBasePath(): string { getCacheBasePath(): string {
return join(app.getPath('userData'), 'cache') return join(this.getUserDataPath(), 'cache')
} }
getAll(): Partial<ConfigSchema> { getAll(): Partial<ConfigSchema> {

View File

@@ -6945,6 +6945,7 @@ class ExportService {
if (collected.rows.length === 0) { if (collected.rows.length === 0) {
return { success: false, error: '该会话在指定时间范围内没有消息' } return { success: false, error: '该会话在指定时间范围内没有消息' }
} }
const totalMessages = collected.rows.length
const senderUsernames = new Set<string>() const senderUsernames = new Set<string>()
let senderScanIndex = 0 let senderScanIndex = 0
@@ -6987,6 +6988,7 @@ class ExportService {
: [] : []
const mediaCache = new Map<string, MediaExportItem | null>() const mediaCache = new Map<string, MediaExportItem | null>()
const mediaDirCache = new Set<string>()
if (mediaMessages.length > 0) { if (mediaMessages.length > 0) {
await this.preloadMediaLookupCaches(sessionId, mediaMessages, { await this.preloadMediaLookupCaches(sessionId, mediaMessages, {