fix(ai-pick): 避免对象展开赋值,使用 Object.keys 浅拷贝

This commit is contained in:
clz
2026-07-21 21:31:14 +08:00
parent b81600b90e
commit 5ee4f56041
+4 -1
View File
@@ -53,7 +53,10 @@ export class AiPickModel {
this.tabs = data;
// 写入 AppStorage:合并式更新(AppStorage 不支持原地改 Map
const current: CardsDataCache = AppStorage.get<CardsDataCache>(APP_STORAGE_CACHE_KEY) ?? {};
const next: CardsDataCache = { ...current };
const next: CardsDataCache = {};
Object.keys(current).forEach((k: string) => {
next[k] = current[k];
});
next[this.cardKey] = data;
AppStorage.setOrCreate<CardsDataCache>(APP_STORAGE_CACHE_KEY, next);
this.dataError = false;