Showing
1 changed file
with
7 additions
and
1 deletions
| 1 | +import 'package:doublefeel_flutter/core/services/health_raw_data_core_service.dart'; | ||
| 1 | import 'package:flutter/scheduler.dart'; | 2 | import 'package:flutter/scheduler.dart'; |
| 2 | import 'package:get/get.dart'; | 3 | import 'package:get/get.dart'; |
| 3 | 4 | ||
| @@ -23,6 +24,8 @@ class SplashController extends GetxController { | @@ -23,6 +24,8 @@ class SplashController extends GetxController { | ||
| 23 | final UserApi _userApi; | 24 | final UserApi _userApi; |
| 24 | final VipApi _vipApi; | 25 | final VipApi _vipApi; |
| 25 | final UserStateService _userStateService; | 26 | final UserStateService _userStateService; |
| 27 | + final HealthRawDataCoreService _healthRawDataCoreService = | ||
| 28 | + Get.find<HealthRawDataCoreService>(); | ||
| 26 | 29 | ||
| 27 | @override | 30 | @override |
| 28 | void onInit() { | 31 | void onInit() { |
| @@ -45,7 +48,10 @@ class SplashController extends GetxController { | @@ -45,7 +48,10 @@ class SplashController extends GetxController { | ||
| 45 | final ok = await _refreshSession(); | 48 | final ok = await _refreshSession(); |
| 46 | if (ok) { | 49 | if (ok) { |
| 47 | await _userStateService.onLogin(); | 50 | await _userStateService.onLogin(); |
| 48 | - Get.offAllNamed(AppRoutes.home); | 51 | + try { |
| 52 | + await _healthRawDataCoreService.startCoreCaculate(); | ||
| 53 | + } catch (_) {} | ||
| 54 | + await Get.offAllNamed(AppRoutes.home); | ||
| 49 | } else { | 55 | } else { |
| 50 | Get.offAllNamed(AppRoutes.login); | 56 | Get.offAllNamed(AppRoutes.login); |
| 51 | } | 57 | } |
-
Please register or login to post a comment