一些修复和优化
This commit is contained in:
@@ -167,6 +167,9 @@ public static class SecureSaveVault
|
||||
DeleteIfExists(GetFilePath(category, key, ".bak"));
|
||||
DeleteIfExists(GetFilePath(category, key, ".tmp"));
|
||||
DeleteLegacyPlainFile(legacyPlainPath);
|
||||
// 同时删除恢复镜像(.save_recovery/*),否则下次 TryLoadRawJson 会从镜像
|
||||
// 复活刚删掉的数据并回写主存档——删除必须彻底,覆盖所有根目录变体与 .bak。
|
||||
DeleteRecoveryCopies(category, key);
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -176,6 +179,15 @@ public static class SecureSaveVault
|
||||
}
|
||||
}
|
||||
|
||||
private static void DeleteRecoveryCopies(string category, string key)
|
||||
{
|
||||
IReadOnlyList<string> candidates = GetRecoveryFilePathVariants(category, key);
|
||||
for (int i = 0; i < candidates.Count; i++)
|
||||
{
|
||||
DeleteIfExists(candidates[i]);
|
||||
}
|
||||
}
|
||||
|
||||
public static List<string> LoadAllRawJson(string category, string legacyDirectory = null, string legacySearchPattern = "*.json")
|
||||
{
|
||||
var result = new List<string>();
|
||||
|
||||
Reference in New Issue
Block a user