mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-08-21 21:47:00 +08:00
fix: 完善交互、知识库目录与 Windows 运行库提示
This commit is contained in:
@@ -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) }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user