fix: 存档key名保持 echo-nexus-save-v1, 靠 version:2 触发 migrate

改 key 名会导致旧用户存档丢失。保持 key 名不变, version 0→2,
persist 自动检测 version 变化调用 migrate 合并字段。
This commit is contained in:
2026-06-24 03:08:49 +00:00
parent 4831505ef9
commit ff54abbf70
+1 -1
View File
@@ -1339,7 +1339,7 @@ export const useGameStore = create<Store>()(
}, },
}), }),
{ {
name: "echo-nexus-save-v2", name: "echo-nexus-save-v1",
version: 2, version: 2,
storage: createJSONStorage(() => localStorage), storage: createJSONStorage(() => localStorage),
// v0.12 存档迁移:旧存档(v0/v1key=echo-nexus-save-v1)补全新增字段,防崩溃 // v0.12 存档迁移:旧存档(v0/v1key=echo-nexus-save-v1)补全新增字段,防崩溃