feat(client): 网络请求重试 + 离线提示可感知重试按钮
修复①请求级重试:新增 RetryInterceptor,网络层失败重试 3 次间隔递增 1s→2s→4s;GET 全重试,写操作仅在连接未建立时重试以防重复提交。 connectTimeout 5s→8s。 修复②连通性:启动首检改退避重试 4s→8s→12s,根治跨境冷启动假离线; 新增检测中状态 + retry();登录页/全局离线提示加 NetworkRetryButton, 重试中转圈、结果 SnackBar 反馈。 121 个测试通过,analyze 无 error。todo #52。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,7 @@ import '../../core/theme/app_theme.dart';
|
||||
import '../../core/storage/login_history.dart';
|
||||
import '../../providers/connectivity_provider.dart';
|
||||
import '../../repositories/auth_repository.dart';
|
||||
import '../../widgets/network_retry_button.dart';
|
||||
|
||||
class LoginScreen extends ConsumerStatefulWidget {
|
||||
const LoginScreen({super.key});
|
||||
@@ -426,6 +427,8 @@ class _LoginScreenState extends ConsumerState<LoginScreen> {
|
||||
fontSize: 13),
|
||||
),
|
||||
),
|
||||
NetworkRetryButton(
|
||||
foreground: Color(0xFF5D4037)),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user