mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-08-17 19:47:08 +08:00
feat: 完善多账号连接诊断与聊天媒体导出
- 新增微信账号发现、环境诊断和分步数据库连接引导 - 支持按账号安全保存数据库密钥及快速切换账号 - 完善 WCDB 历史消息分片读取和分页状态提示 - 支持导出图片、视频和语音,提供原图优先及缩略图回退 - 更新安装指引、兼容版本说明和相关自动化测试
This commit is contained in:
@@ -102,7 +102,7 @@ handle('key:getSavedDbKey', () => ({
|
||||
saved: Boolean(savedKey),
|
||||
encryptionAvailable: true
|
||||
}))
|
||||
handle('key:saveDbKey', (key) => {
|
||||
handle('key:saveDbKey', (_accountRoot, key) => {
|
||||
savedKey = String(key || '')
|
||||
return { success: true, key: savedKey, saved: true, encryptionAvailable: true }
|
||||
})
|
||||
@@ -112,6 +112,12 @@ handle('key:clearSavedDbKey', () => {
|
||||
})
|
||||
handle('key:getEnvironment', () => ({
|
||||
platform: process.platform,
|
||||
osVersion: process.platform === 'win32' ? 'Windows fixture' : 'macOS fixture',
|
||||
appVersion: 'v2.1.6',
|
||||
wechatVersion: '4.1.9.57',
|
||||
dataStructureVersion: settings.dbRoot === 'fixture-account' ? '微信 4.x(WCDB)' : '未检测到',
|
||||
dataDirectoryDetected: settings.dbRoot === 'fixture-account',
|
||||
diagnosticSummary: 'WechatExplorer: v2.1.6\n数据目录: 已检测到',
|
||||
autoDetectSupported: true,
|
||||
wechatRunning: true,
|
||||
accountIdentified: connected,
|
||||
@@ -128,12 +134,22 @@ handle('key:autoGetImageKey', () => ({
|
||||
verified: true
|
||||
}))
|
||||
|
||||
handle('db:init', (key) => {
|
||||
handle('db:init', (key, accountRoot) => {
|
||||
if (settings.dbRoot === 'Z:\\missing-wechat-data') {
|
||||
connected = false
|
||||
return {
|
||||
success: false,
|
||||
code: 'ROOT_UNAVAILABLE',
|
||||
error: '微信数据目录不存在,请重新选择目录',
|
||||
monitoring: false
|
||||
}
|
||||
}
|
||||
if (key !== VALID_KEY) {
|
||||
connected = false
|
||||
return { success: false, error: '数据库密钥无效', monitoring: false }
|
||||
}
|
||||
connected = true
|
||||
settings.dbRoot = accountRoot || settings.dbRoot
|
||||
return { success: true, monitoring: true }
|
||||
})
|
||||
handle('db:testConnection', (key) =>
|
||||
@@ -339,6 +355,29 @@ handle('image:getStatus', () => ({
|
||||
])
|
||||
)
|
||||
}))
|
||||
handle('settings:selectDbRoot', () => ({ canceled: false, path: 'fixture-account' }))
|
||||
handle('accounts:discover', (inputPath) =>
|
||||
inputPath === 'Z:\\missing-wechat-data'
|
||||
? { success: false, accounts: [], error: '微信数据目录不存在,请重新选择目录' }
|
||||
: {
|
||||
success: true,
|
||||
inputKind: 'account',
|
||||
preselectedAccountId: 'fixture-account-id',
|
||||
accounts: [
|
||||
{
|
||||
id: 'fixture-account-id',
|
||||
accountRoot: inputPath || 'fixture-account',
|
||||
directoryName: 'fixture-account',
|
||||
wxid: fixture.self.wxid,
|
||||
nickname: fixture.self.nickname,
|
||||
avatar: fixture.self.avatar,
|
||||
hasSavedDbKey: Boolean(savedKey),
|
||||
loginStatus: connected ? 'current' : 'unknown',
|
||||
selectedByInput: true
|
||||
}
|
||||
]
|
||||
}
|
||||
)
|
||||
handle('agent-hub:getStatus', () => ({ state: 'disconnected', connected: false }))
|
||||
handle('agent-hub:getLogs', () => [])
|
||||
handle('app-update:getState', () => ({ status: 'idle', currentVersion: '2.1.6' }))
|
||||
@@ -347,7 +386,6 @@ for (const channel of [
|
||||
'export:start',
|
||||
'export:cancel',
|
||||
'export:reveal',
|
||||
'settings:selectDbRoot',
|
||||
'settings:openAccountRoot',
|
||||
'db:reopenWithRoot',
|
||||
'api:skillStatus',
|
||||
|
||||
Reference in New Issue
Block a user