fix: backup_registry 改为内部读取注册表当前值,不再依赖前端传入数据

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-26 22:04:16 +08:00
parent 2775a3a588
commit 804e02004d
3 changed files with 30 additions and 17 deletions
+2 -2
View File
@@ -259,8 +259,8 @@ export const useAppStore = create<AppState>((set, get) => ({
if (!window.confirm('PATH 长度超过建议值,是否继续保存?')) { set({ isSaving: false }); return; }
}
// 备份(失败时通知用户
invoke('backup_registry', { customDir: null, sysPaths, userPaths })
// 备份当前注册表(保存前备份旧值,失败仅警告不中断
invoke('backup_registry', { customDir: null })
.catch(() => set({ statusMessage: i18n.t('status.warning_backup') }));
const [sysResult, userResult] = await Promise.allSettled([