fix: 修复朋友圈图片显示"已删除"和数据库备份卡住的两个 Bug
1. snsService.ts: fixSnsUrl 正则只处理 /150 缩略图路径, 实际 CDN 返回 /200 导致 HTTP 400,改为支持 /150|200|480 2. backupService.ts: inspectBackup 缺少完成事件导致界面卡死, ensureConnected 中 accountDirName 变量名未定义
This commit is contained in:
1 parent
ca6c479496
commit
89eef5a922
2 files changed
+17
-4
No files matched your search
@@ -467,10 +467,10 @@ export class BackupService {
|
||||
)
|
||||
if (!opened) {
|
||||
const detail = await wcdbService.getLastInitError().catch(() => null)
|
||||
return { success: false, error: detail || `目标账号 ${accountDirName} 数据库连接失败` }
|
||||
return { success: false, error: detail || `目标账号 ${accountDir} 数据库连接失败` }
|
||||
}
|
||||
|
||||
return { success: true, wxid: accountDirName, dbPath, dbStorage }
|
||||
return { success: true, wxid: accountDir, dbPath, dbStorage }
|
||||
}
|
||||
|
||||
private buildDbId(kind: BackupDbKind, index: number, dbPath: string): string {
|
||||
@@ -857,10 +857,13 @@ export class BackupService {
|
||||
if (!existsSync(manifestPath)) return { success: false, error: '备份包缺少 manifest.json' }
|
||||
const manifest = JSON.parse(await readFileAsync(manifestPath, 'utf8')) as BackupManifest
|
||||
if (manifest?.type !== 'weflow-db-snapshots' || manifest.version !== 1) {
|
||||
emitBackupProgress({ phase: 'failed', message: '不支持的备份包格式' })
|
||||
return { success: false, error: '不支持的备份包格式' }
|
||||
}
|
||||
emitBackupProgress({ phase: 'done', message: '备份包已读取' })
|
||||
return { success: true, manifest }
|
||||
} catch (e) {
|
||||
emitBackupProgress({ phase: 'failed', message: e instanceof Error ? e.message : String(e) })
|
||||
return { success: false, error: e instanceof Error ? e.message : String(e) }
|
||||
} finally {
|
||||
if (extractDir) {
|
||||
|
||||
Reference in new issue
Block a user