根因:switchToAccount() 流程中,定时器在 _clearCurrentAccountData() 之后才停止。clear 阶段会删除 token,但此时定时器仍在运行, in-flight 的 API 请求收到 401 → 触发 _handleTokenExpired() → 调用 logoutCurrentAccount() 把正在恢复的新账号数据全部清掉 → 用户被自动踢到登录页面。 修复:将 onBeforeRestore 回调(停止定时器)移到 _clearCurrentAccountData() 之前执行,确保所有 API 请求停止后再清除 token。 修改前: save → clear(删token) → 停定时器 → restore 修改后: save → 停定时器 → clear(删token) → restore 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.