chore: release client-v1.0.61
Deploy Client / build-client-web (push) Successful in 38s
Deploy Client / build-windows (push) Successful in 1m52s
Deploy Client / build-macos (push) Successful in 1m55s
Deploy Client / build-android (push) Successful in 1m0s
Deploy Client / build-ios (push) Successful in 2m47s
Deploy Client / release-deploy-client (push) Successful in 1m21s
Deploy Client / build-client-web (push) Successful in 38s
Deploy Client / build-windows (push) Successful in 1m52s
Deploy Client / build-macos (push) Successful in 1m55s
Deploy Client / build-android (push) Successful in 1m0s
Deploy Client / build-ios (push) Successful in 2m47s
Deploy Client / release-deploy-client (push) Successful in 1m21s
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import '../core/config/app_config.dart';
|
||||
import '../core/config/app_constants.dart';
|
||||
|
||||
// ── 数据模型 ────────────────────────────────────────────────
|
||||
class AppUpdateInfo {
|
||||
@@ -40,8 +41,8 @@ class UpdateNotifier extends AsyncNotifier<AppUpdateInfo?> {
|
||||
bool _dismissed = false; // 用户已手动关闭非强制更新提示
|
||||
|
||||
final _dio = Dio(BaseOptions(
|
||||
connectTimeout: const Duration(seconds: 5),
|
||||
receiveTimeout: const Duration(seconds: 5),
|
||||
connectTimeout: AppConstants.updateCheckTimeout,
|
||||
receiveTimeout: AppConstants.updateCheckTimeout,
|
||||
));
|
||||
|
||||
@override
|
||||
@@ -51,12 +52,12 @@ class UpdateNotifier extends AsyncNotifier<AppUpdateInfo?> {
|
||||
_dio.close(force: true);
|
||||
});
|
||||
|
||||
// 启动后 3 秒延迟首次检查(避免与登录请求竞争)
|
||||
await Future.delayed(const Duration(seconds: 3));
|
||||
// 启动后延迟首次检查(避免与登录请求竞争)
|
||||
await Future.delayed(AppConstants.updateInitialDelay);
|
||||
final result = await _check();
|
||||
|
||||
// 每小时检查一次
|
||||
_timer = Timer.periodic(const Duration(hours: 1), (_) async {
|
||||
// 定期检查更新
|
||||
_timer = Timer.periodic(AppConstants.updatePollInterval, (_) async {
|
||||
_dismissed = false;
|
||||
final r = await _check();
|
||||
state = AsyncValue.data(r);
|
||||
|
||||
Reference in New Issue
Block a user