fix: 完善交互、知识库目录与 Windows 运行库提示

This commit is contained in:
电摇小子
2026-08-11 02:59:30 +08:00
parent 32864ff88c
commit 8a0d3b02d9
16 changed files with 283 additions and 20 deletions
+13 -2
View File
@@ -1,4 +1,4 @@
import { app, session } from 'electron'
import { app, session, shell } from 'electron'
import fs from 'fs-extra'
import path from 'path'
import { clearBootstrapCache } from './bootstrap-cache'
@@ -62,7 +62,8 @@ export function getCacheSummary(): CacheSummary {
{
id: 'knowledge',
label: '本地知识库索引',
description: '为问问微信建立的所有账号本地检索索引。清理后需手动重新建立,不影响微信原始数据。',
description:
'为问问微信建立的所有账号本地检索索引。清理后需手动重新建立,不影响微信原始数据。',
...knowledge
}
]
@@ -90,3 +91,13 @@ export async function clearCache(
}
return getCacheSummary()
}
export async function openKnowledgeDirectory(): Promise<{ success: boolean; error?: string }> {
try {
await fs.ensureDir(KNOWLEDGE_CACHE_DIR)
const error = await shell.openPath(KNOWLEDGE_CACHE_DIR)
return error ? { success: false, error } : { success: true }
} catch (error) {
return { success: false, error: error instanceof Error ? error.message : String(error) }
}
}