feat: 重构会话管理与提醒通知系统
This commit is contained in:
Vendored
+9
-1
@@ -14,9 +14,17 @@ class CacheScope {
|
||||
}
|
||||
|
||||
static String token() {
|
||||
final value = maybeToken();
|
||||
if (value == null) {
|
||||
throw StateError('CacheScope not configured - user must be logged in');
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
static String? maybeToken() {
|
||||
final raw = _provider?.call()?.trim();
|
||||
if (raw == null || raw.isEmpty) {
|
||||
return 'anonymous';
|
||||
return null;
|
||||
}
|
||||
return raw;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user