|
|
|
import 'package:doublefeel_flutter/core/services/health_raw_data_core_service.dart';
|
|
|
|
import 'package:flutter/scheduler.dart';
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
|
|
...
|
...
|
@@ -23,6 +24,8 @@ class SplashController extends GetxController { |
|
|
|
final UserApi _userApi;
|
|
|
|
final VipApi _vipApi;
|
|
|
|
final UserStateService _userStateService;
|
|
|
|
final HealthRawDataCoreService _healthRawDataCoreService =
|
|
|
|
Get.find<HealthRawDataCoreService>();
|
|
|
|
|
|
|
|
@override
|
|
|
|
void onInit() {
|
|
...
|
...
|
@@ -45,7 +48,10 @@ class SplashController extends GetxController { |
|
|
|
final ok = await _refreshSession();
|
|
|
|
if (ok) {
|
|
|
|
await _userStateService.onLogin();
|
|
|
|
Get.offAllNamed(AppRoutes.home);
|
|
|
|
try {
|
|
|
|
await _healthRawDataCoreService.startCoreCaculate();
|
|
|
|
} catch (_) {}
|
|
|
|
await Get.offAllNamed(AppRoutes.home);
|
|
|
|
} else {
|
|
|
|
Get.offAllNamed(AppRoutes.login);
|
|
|
|
}
|
...
|
...
|
|