feat: 添加缓存作用域支持多用户数据隔离

This commit is contained in:
zl-q
2026-03-30 09:06:24 +08:00
parent 4285b4ec80
commit 41f35d6e22
4 changed files with 72 additions and 14 deletions
+3 -1
View File
@@ -3,6 +3,8 @@ import 'dart:convert';
import 'package:shared_preferences/shared_preferences.dart';
import 'cache_scope.dart';
class CacheEntry<T> {
const CacheEntry({required this.value, required this.fetchedAt});
@@ -196,7 +198,7 @@ class CacheInvalidator {
void invalidate(String key) {
final store = _store;
if (store != null) {
unawaited(store.remove(key));
unawaited(store.remove(CacheScope.scopedKey(key)));
}
}