根因:切换账号时 saveCurrentAccountData() 耗时 ~7 秒,期间定时器仍在发 API 请求, clear 阶段 token 被删除后 in-flight 请求收到 401 → 触发 tokenExpired → logoutCurrentAccount() 把刚恢复的新账号数据全部擦除。 修复(两层防护): 1. 全局锁 isSwitchingAccount:MultiAccountService 在 switchToAccount 整个过程中 设为 true,app.dart _handleTokenExpired 检测到该标志直接 return,不执行 logout 2. 定时器提前停止:将定时器停止从 onBeforeRestore(save 之后)移到 switchToAccount 调用之前,确保 save 期间无新 API 请求 3. try/finally 保证标志位必定清除,异常情况不会锁死后续 tokenExpired 事件 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| .claude | ||
| android | ||
| assets | ||
| docs | ||
| ios | ||
| lib | ||
| linux | ||
| macos | ||
| scripts | ||
| test | ||
| web | ||
| windows | ||
| .gitignore | ||
| .metadata | ||
| CLAUDE.md | ||
| README.MD | ||
| analysis_options.yaml | ||
| flutter_android_update_guide.md | ||
| flutter_telemetry_solution.md | ||
| pubspec.lock | ||
| pubspec.yaml | ||
| quickly.lottie | ||
| stickman.lottie | ||
README.MD
Create Flutter Framework
C:\Users\ph\Desktop\app>flutter create --org com.rwadurian rwa_android_app
Creating project rwa_android_app...
Resolving dependencies in `rwa_android_app`... (3.7s)
Downloading packages...
Got dependencies in `rwa_android_app`.
Wrote 130 files.
All done!
You can find general documentation for Flutter at: https://docs.flutter.dev/
Detailed API documentation is available at: https://api.flutter.dev/
If you prefer video documentation, consider: https://www.youtube.com/c/flutterdev
In order to run your application, type:
$ cd rwa_android_app
$ flutter run
Your application code is in rwa_android_app\lib\main.dart.
rwa_android_app
A new Flutter project.
Getting Started
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
For help getting started with Flutter development, view the online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.