fix(mobile-app): 修复退出登录报错问题
- TelemetryStorage.clearUserData() 添加初始化检查 - 移除 logoutCurrentAccount() 中多余的保存数据逻辑 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
2a929fc082
commit
4e4d9f43f6
|
|
@ -387,9 +387,6 @@ class MultiAccountService {
|
||||||
Future<void> logoutCurrentAccount() async {
|
Future<void> logoutCurrentAccount() async {
|
||||||
debugPrint('$_tag logoutCurrentAccount() - 退出当前账号');
|
debugPrint('$_tag logoutCurrentAccount() - 退出当前账号');
|
||||||
|
|
||||||
// 保存当前账号数据
|
|
||||||
await saveCurrentAccountData();
|
|
||||||
|
|
||||||
// 清除当前账号标记
|
// 清除当前账号标记
|
||||||
await setCurrentAccountId(null);
|
await setCurrentAccountId(null);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -106,6 +106,9 @@ class TelemetryStorage {
|
||||||
/// 清空所有遥测数据(退出登录时调用)
|
/// 清空所有遥测数据(退出登录时调用)
|
||||||
/// 保留 installId 和 deviceContext(设备级别数据)
|
/// 保留 installId 和 deviceContext(设备级别数据)
|
||||||
Future<void> clearUserData() async {
|
Future<void> clearUserData() async {
|
||||||
|
if (!_isInitialized) {
|
||||||
|
await init();
|
||||||
|
}
|
||||||
await _prefs.remove(_keyEventQueue);
|
await _prefs.remove(_keyEventQueue);
|
||||||
debugPrint('📊 TelemetryStorage: 已清除用户相关遥测数据');
|
debugPrint('📊 TelemetryStorage: 已清除用户相关遥测数据');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue