feat: 1.调整项目初始化,不用等待site/config接口,仅在hi_user_info中调用;将site_config_service拆成loadDomain和获取配置,在splash中只做loadDomain
2. 优化接口拦截的解密日志 3. 调整获取订阅到kr_home,与源版一致 4. 修复闪连抖动问题,增加套餐有效期判断
This commit is contained in:
@@ -35,10 +35,10 @@ class KRSplashController extends GetxController {
|
||||
final _initLog = KRInitLogCollector();
|
||||
// 加载状态
|
||||
final RxBool kr_isLoading = true.obs;
|
||||
|
||||
|
||||
// 错误状态
|
||||
final RxBool kr_hasError = false.obs;
|
||||
|
||||
|
||||
// 错误信息
|
||||
final RxString kr_errorMessage = ''.obs;
|
||||
|
||||
@@ -65,14 +65,8 @@ class KRSplashController extends GetxController {
|
||||
_stepStartTime = _startTime;
|
||||
|
||||
// 使用 print 确保日志一定会输出
|
||||
print('[SPLASH_TIMING] ═══════════════════════════════════════');
|
||||
print('[SPLASH_TIMING] 🎬 KRSplashController onInit 被调用了!');
|
||||
print('[SPLASH_TIMING] ⏰ 启动开始时间: ${_startTime.toIso8601String()}');
|
||||
print('[SPLASH_TIMING] ═══════════════════════════════════════');
|
||||
|
||||
KRLogUtil.kr_i('[SPLASH_TIMING] ═══════════════════════════════════════', tag: 'SplashController');
|
||||
KRLogUtil.kr_i('[SPLASH_TIMING] 🎬 启动页控制器 onInit', tag: 'SplashController');
|
||||
KRLogUtil.kr_i('[SPLASH_TIMING] ═══════════════════════════════════════', tag: 'SplashController');
|
||||
|
||||
// 🔧 修复1.0:新增 - DEBUG模式下清理旧数据
|
||||
// ⚠️ 仅在DEBUG模式下执行,防止误删生产环境用户数据
|
||||
@@ -85,15 +79,6 @@ class KRSplashController extends GetxController {
|
||||
print('🧹 清理域名检测状态...');
|
||||
KRDomain.kr_resetDomainState();
|
||||
|
||||
// 🔧 P2优化:网站配置不再后台执行,改为串行执行以确保域名验证完成
|
||||
// print('🌐 启动后台任务:网站配置加载...');
|
||||
// KRLogUtil.kr_i('🌐 后台任务:网站配置和设备登录', tag: 'SplashController');
|
||||
// _kr_initSiteConfig(); // 移至 _kr_continueInitialization 中串行执行
|
||||
|
||||
// 🔧 关键修复:先初始化日志收集器,再开始主流程
|
||||
if (kDebugMode) {
|
||||
print('🔧 初始化日志收集器...');
|
||||
}
|
||||
_initializeAndStart();
|
||||
}
|
||||
|
||||
@@ -130,21 +115,15 @@ class KRSplashController extends GetxController {
|
||||
final totalMs = totalDuration.inMilliseconds;
|
||||
|
||||
print('[SPLASH_TIMING] ⏱️ $stepName 耗时: ${stepMs}ms | 累计: ${totalMs}ms');
|
||||
KRLogUtil.kr_i('[SPLASH_TIMING] ⏱️ $stepName 耗时: ${stepMs}ms | 累计: ${totalMs}ms', tag: 'SplashController');
|
||||
KRLogUtil.kr_i(
|
||||
'[SPLASH_TIMING] ⏱️ $stepName 耗时: ${stepMs}ms | 累计: ${totalMs}ms',
|
||||
tag: 'SplashController');
|
||||
|
||||
_stepStartTime = now; // 更新步骤开始时间
|
||||
}
|
||||
|
||||
/// 初始化网站配置(后台执行,不阻塞主流程)
|
||||
Future<void> _kr_initSiteConfig() async {
|
||||
print('[SPLASH_TIMING] ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
||||
print('[SPLASH_TIMING] 🌐 开始初始化网站配置...');
|
||||
print('[SPLASH_TIMING] ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
||||
|
||||
KRLogUtil.kr_i('[SPLASH_TIMING] ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━', tag: 'SplashController');
|
||||
KRLogUtil.kr_i('[SPLASH_TIMING] 🌐 初始化网站配置...', tag: 'SplashController');
|
||||
KRLogUtil.kr_i('[SPLASH_TIMING] ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━', tag: 'SplashController');
|
||||
|
||||
try {
|
||||
// 🔧 Android 15 优化:延长超时保护到25秒,匹配网络请求超时(20秒 + 5秒缓冲)
|
||||
await Future.any([
|
||||
@@ -162,116 +141,20 @@ class KRSplashController extends GetxController {
|
||||
}
|
||||
|
||||
print('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
||||
KRLogUtil.kr_i('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━', tag: 'SplashController');
|
||||
KRLogUtil.kr_i('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━',
|
||||
tag: 'SplashController');
|
||||
}
|
||||
|
||||
/// 执行网站配置初始化
|
||||
Future<void> _executeSiteConfigInit() async {
|
||||
print('📞 准备调用 KRSiteConfigService().initialize()...');
|
||||
final success = await KRSiteConfigService().initialize();
|
||||
final crispId = await KRSiteConfigService().getCrispId();
|
||||
final device_limit = await KRSiteConfigService().getDeviceLimit();
|
||||
print('📞 KRSiteConfigService().initialize() 返回: $success');
|
||||
|
||||
if (success) {
|
||||
final config = AppConfig.getInstance();
|
||||
config.kr_website_id = crispId;
|
||||
config.device_limit = device_limit;
|
||||
print('📞 KRSiteConfigService().initialize() 返回: $crispId');
|
||||
print('AppConfig website_id 已更新为: ${config.kr_website_id}');
|
||||
print('AppConfig device_limit 已更新为: ${config.device_limit}');
|
||||
|
||||
// print('[SPLASH_TIMING] ✅ 网站配置初始化成功');
|
||||
// await _kr_checkAndPerformDeviceLogin();
|
||||
} else {
|
||||
print('⚠️ 网站配置初始化失败,将使用默认配置');
|
||||
KRLogUtil.kr_w('⚠️ 网站配置初始化失败,将使用默认配置', tag: 'SplashController');
|
||||
}
|
||||
print('📞 准备调用 KRDomain.kr_loadBaseDomain()...');
|
||||
await KRDomain.kr_loadBaseDomain();
|
||||
print('📞 KRDomain.kr_loadBaseDomain() 完成');
|
||||
}
|
||||
|
||||
/// 检查并执行设备登录(后台执行,有超时保护)
|
||||
Future<void> _kr_checkAndPerformDeviceLogin() async {
|
||||
try {
|
||||
print('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
||||
print('🔍 检查是否支持设备登录...');
|
||||
print('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
||||
|
||||
final siteConfigService = KRSiteConfigService();
|
||||
|
||||
// 检查是否启用设备登录
|
||||
final isDeviceLoginEnabled = siteConfigService.isDeviceLoginEnabled();
|
||||
print('📱 设备登录状态: ${isDeviceLoginEnabled ? "已启用" : "未启用"}');
|
||||
KRLogUtil.kr_i('📱 设备登录状态: $isDeviceLoginEnabled', tag: 'SplashController');
|
||||
|
||||
if (!isDeviceLoginEnabled) {
|
||||
print('⚠️ 设备登录未启用,跳过自动登录');
|
||||
KRLogUtil.kr_w('⚠️ 设备登录未启用', tag: 'SplashController');
|
||||
return;
|
||||
}
|
||||
|
||||
print('✅ 设备登录已启用,开始初始化设备信息...');
|
||||
|
||||
// 🔧 Android 15 优化:延长设备登录超时到15秒,匹配网络请求超时
|
||||
await Future.any([
|
||||
_executeDeviceLogin(),
|
||||
Future.delayed(const Duration(seconds: 15), () {
|
||||
throw TimeoutException('设备登录超时(15秒)');
|
||||
}),
|
||||
]);
|
||||
|
||||
print('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
||||
} on TimeoutException catch (e) {
|
||||
print('⏱️ 设备登录超时,应用将继续启动: $e');
|
||||
KRLogUtil.kr_w('⏱️ 设备登录超时: $e', tag: 'SplashController');
|
||||
} catch (e, stackTrace) {
|
||||
print('❌ 设备登录检查异常: $e');
|
||||
print('📚 堆栈跟踪: $stackTrace');
|
||||
KRLogUtil.kr_e('❌ 设备登录检查异常: $e', tag: 'SplashController');
|
||||
}
|
||||
}
|
||||
|
||||
/// 执行设备登录
|
||||
Future<void> _executeDeviceLogin() async {
|
||||
// 初始化设备信息服务
|
||||
await KRDeviceInfoService().initialize();
|
||||
|
||||
print('🔐 开始执行设备登录...');
|
||||
KRLogUtil.kr_i('🔐 开始执行设备登录', tag: 'SplashController');
|
||||
|
||||
// 执行设备登录
|
||||
final authApi = KRAuthApi();
|
||||
final result = await authApi.kr_deviceLogin();
|
||||
|
||||
result.fold(
|
||||
(error) {
|
||||
print('❌ 设备登录失败: ${error.msg}');
|
||||
KRLogUtil.kr_e('❌ 设备登录失败: ${error.msg}', tag: 'SplashController');
|
||||
},
|
||||
(token) async {
|
||||
print('✅ 设备登录成功!');
|
||||
print('🎫 Token: ${token.substring(0, min(20, token.length))}...');
|
||||
KRLogUtil.kr_i('✅ 设备登录成功', tag: 'SplashController');
|
||||
|
||||
// 使用 saveUserInfo 保存完整的用户信息
|
||||
// 设备登录使用特殊的账号标识,登录类型设为邮箱(后续可以绑定真实账号)
|
||||
final deviceId = KRDeviceInfoService().deviceId ?? 'unknown';
|
||||
await KRAppRunData.getInstance().kr_saveUserInfo(
|
||||
token,
|
||||
'device_$deviceId', // 使用设备ID作为临时账号
|
||||
KRLoginType.kr_email, // 默认登录类型
|
||||
null, // 设备登录无需区号
|
||||
);
|
||||
print('💾 用户信息已保存(包括Token)');
|
||||
print('✅ 已标记为登录状态');
|
||||
KRLogUtil.kr_i('✅ 设备登录流程完成', tag: 'SplashController');
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _kr_initialize() async {
|
||||
try {
|
||||
_initLog.logPhaseStart('主初始化流程');
|
||||
_initLog.log('开始执行 _kr_initialize', tag: 'Splash');
|
||||
KRLogUtil.kr_i('🔧 开始执行 _kr_initialize', tag: 'SplashController');
|
||||
|
||||
// 🔧 Android 15 优化:添加总体超时保护(15秒),更快响应
|
||||
@@ -304,7 +187,8 @@ class KRSplashController extends GetxController {
|
||||
_handleError('网络连接失败', '请检查您的网络连接是否正常,然后重试。');
|
||||
} on DioException catch (e) {
|
||||
// 🔧 P2优化:HTTP请求错误
|
||||
KRLogUtil.kr_e('❌ HTTP请求错误: ${e.type} - ${e.message}', tag: 'SplashController');
|
||||
KRLogUtil.kr_e('❌ HTTP请求错误: ${e.type} - ${e.message}',
|
||||
tag: 'SplashController');
|
||||
final errorMsg = _getDioErrorMessage(e);
|
||||
_handleError('服务请求失败', errorMsg);
|
||||
} catch (e) {
|
||||
@@ -328,10 +212,13 @@ class KRSplashController extends GetxController {
|
||||
// 1. 设置默认域名(确保应用有可用域名)
|
||||
try {
|
||||
_initLog.log('步骤1: 设置默认域名', tag: 'Minimal');
|
||||
if (KRDomain.kr_currentDomain.isEmpty && KRDomain.kr_baseDomains.isNotEmpty) {
|
||||
if (KRDomain.kr_currentDomain.isEmpty &&
|
||||
KRDomain.kr_baseDomains.isNotEmpty) {
|
||||
KRDomain.kr_currentDomain = KRDomain.kr_baseDomains[0];
|
||||
_initLog.logSuccess('设置默认域名: ${KRDomain.kr_currentDomain}', tag: 'Minimal');
|
||||
KRLogUtil.kr_i('✅ 设置默认域名: ${KRDomain.kr_currentDomain}', tag: 'SplashController');
|
||||
_initLog.logSuccess('设置默认域名: ${KRDomain.kr_currentDomain}',
|
||||
tag: 'Minimal');
|
||||
KRLogUtil.kr_i('✅ 设置默认域名: ${KRDomain.kr_currentDomain}',
|
||||
tag: 'SplashController');
|
||||
if (kDebugMode) {
|
||||
print('✅ 设置默认域名: ${KRDomain.kr_currentDomain}');
|
||||
}
|
||||
@@ -509,21 +396,15 @@ class KRSplashController extends GetxController {
|
||||
|
||||
Future<void> _kr_continueInitialization() async {
|
||||
try {
|
||||
_initLog.logSeparator();
|
||||
_initLog.log('🚀 启动页主流程开始', tag: 'Continue');
|
||||
_initLog.logSeparator();
|
||||
|
||||
KRLogUtil.kr_i('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━', tag: 'SplashController');
|
||||
KRLogUtil.kr_i('🚀 启动页主流程开始...', tag: 'SplashController');
|
||||
KRLogUtil.kr_i('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━', tag: 'SplashController');
|
||||
|
||||
// 🔧 Android 15 优化:网络连接检查改为非阻塞
|
||||
if (Platform.isIOS || Platform.isAndroid) {
|
||||
_initLog.log('📱 检查网络连接状态(超时5秒)', tag: 'Continue');
|
||||
KRLogUtil.kr_i('📱 检查网络连接...', tag: 'SplashController');
|
||||
try {
|
||||
// 添加5秒超时保护
|
||||
final bool isConnected = await KRNetworkCheck.kr_checkNetworkConnection().timeout(
|
||||
final bool isConnected =
|
||||
await KRNetworkCheck.kr_checkNetworkConnection().timeout(
|
||||
const Duration(seconds: 5),
|
||||
onTimeout: () {
|
||||
_initLog.logWarning('网络连接检查超时(5秒),继续初始化', tag: 'Continue');
|
||||
@@ -550,8 +431,6 @@ class KRSplashController extends GetxController {
|
||||
KRLogUtil.kr_i('💻 桌面平台,跳过网络连接检查', tag: 'SplashController');
|
||||
}
|
||||
|
||||
// 网络检查完成后执行设备登录(始终支持)
|
||||
|
||||
// 🔧 关键修复:在设备登录前先初始化站点配置,确保域名可用
|
||||
// 这样如果主域名不可用,initSiteConfig 会切换到备用域名
|
||||
// 后续的设备登录就能使用正确的域名
|
||||
@@ -561,7 +440,8 @@ class KRSplashController extends GetxController {
|
||||
|
||||
_logStepTiming('开始设备登录检查');
|
||||
// 5️⃣ 执行设备登录
|
||||
final success = await KRAppRunData.getInstance().kr_checkAndPerformDeviceLogin();
|
||||
final success =
|
||||
await KRAppRunData.getInstance().kr_checkAndPerformDeviceLogin();
|
||||
|
||||
if (!success) {
|
||||
// 设备登录失败 → 提示用户重试
|
||||
@@ -582,7 +462,7 @@ class KRSplashController extends GetxController {
|
||||
// 下面AppConfig().initConfig主要是做AppConfig层面的配置加载,可能包含重复的请求。
|
||||
// 鉴于 AppConfig().initConfig 也会调用 API,为了保险起见,
|
||||
// 我们可以让 AppConfig().initConfig 使用已经切换好的域名。)
|
||||
|
||||
|
||||
_initLog.log('⚙️ 开始初始化应用配置(域名加载等)', tag: 'Continue');
|
||||
KRLogUtil.kr_i('⚙️ 开始初始化应用配置...', tag: 'SplashController');
|
||||
await AppConfig().initConfig(
|
||||
@@ -605,12 +485,7 @@ class KRSplashController extends GetxController {
|
||||
// 配置初始化成功后的后续步骤
|
||||
Future<void> _kr_continueAfterConfig() async {
|
||||
try {
|
||||
// 用户信息初始化完成后,立即初始化订阅服务
|
||||
print('[SPLASH_TIMING] 🔄 开始初始化订阅服务...');
|
||||
KRLogUtil.kr_i('[SPLASH_TIMING] 🔄 开始初始化订阅服务', tag: 'SplashController');
|
||||
_kr_ensureSubscribeServiceInitialized();
|
||||
|
||||
// 初始化SingBox
|
||||
// 初始化SingBox(必须先于订阅服务,避免目录未初始化)
|
||||
_logStepTiming('开始SingBox初始化');
|
||||
await KRSingBoxImp.instance.init();
|
||||
_logStepTiming('SingBox初始化完成');
|
||||
@@ -620,20 +495,12 @@ class KRSplashController extends GetxController {
|
||||
final token = KRAppRunData.getInstance().kr_token;
|
||||
final hasToken = token != null && token.isNotEmpty;
|
||||
|
||||
print('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
||||
print('🎯 准备进入主页');
|
||||
print('📊 最终登录状态: $loginStatus');
|
||||
print('🎫 Token存在: $hasToken');
|
||||
if (hasToken) {
|
||||
print('🎫 Token前缀: ${token.substring(0, min(20, token.length))}...');
|
||||
}
|
||||
print('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
||||
|
||||
KRLogUtil.kr_i('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━', tag: 'SplashController');
|
||||
KRLogUtil.kr_i('🎯 准备进入主页', tag: 'SplashController');
|
||||
KRLogUtil.kr_i('📊 最终登录状态: $loginStatus', tag: 'SplashController');
|
||||
KRLogUtil.kr_i('🎫 Token存在: $hasToken', tag: 'SplashController');
|
||||
KRLogUtil.kr_i('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━', tag: 'SplashController');
|
||||
|
||||
// 🔧 记录最终状态到日志
|
||||
_initLog.logSeparator();
|
||||
@@ -652,12 +519,13 @@ class KRSplashController extends GetxController {
|
||||
|
||||
// 直接导航到主页(无论是否登录,主页会根据登录状态显示不同内容)
|
||||
_logStepTiming('开始页面导航');
|
||||
if(loginStatus) {
|
||||
if (loginStatus) {
|
||||
// 直接导航到主页
|
||||
Get.offAllNamed(Routes.KR_HOME);
|
||||
}else {
|
||||
} else {
|
||||
kr_hasError.value = true;
|
||||
kr_errorMessage.value = '登录:${AppTranslations.kr_splash.kr_initializationFailed}';
|
||||
kr_errorMessage.value =
|
||||
'登录:${AppTranslations.kr_splash.kr_initializationFailed}';
|
||||
}
|
||||
_logStepTiming('页面导航完成');
|
||||
} catch (e) {
|
||||
@@ -667,63 +535,22 @@ class KRSplashController extends GetxController {
|
||||
final totalMs = totalDuration.inMilliseconds;
|
||||
|
||||
print('❌ 启动失败时间: ${endTime.toIso8601String()}');
|
||||
print('🕐 启动失败总耗时: ${totalMs}ms (${totalDuration.inSeconds}.${(totalMs % 1000).toString().padLeft(3, '0')}s)');
|
||||
print(
|
||||
'🕐 启动失败总耗时: ${totalMs}ms (${totalDuration.inSeconds}.${(totalMs % 1000).toString().padLeft(3, '0')}s)');
|
||||
|
||||
// 后续步骤失败,显示错误信息
|
||||
_initLog.logError('启动初始化失败', tag: 'Splash', error: e);
|
||||
KRLogUtil.kr_e('启动初始化失败: $e', tag: 'SplashController');
|
||||
KRLogUtil.kr_e('⏰ 启动失败总耗时: ${totalMs}ms', tag: 'SplashController');
|
||||
kr_hasError.value = true;
|
||||
kr_errorMessage.value = '${AppTranslations.kr_splash.kr_initializationFailed}$e';
|
||||
kr_errorMessage.value =
|
||||
'${AppTranslations.kr_splash.kr_initializationFailed}$e';
|
||||
|
||||
// 🔧 错误情况下也不关闭日志,让后续的错误处理也能写入
|
||||
// await _initLog.finalize(); // ❌ 注释掉
|
||||
}
|
||||
}
|
||||
|
||||
/// 确保订阅服务初始化
|
||||
Future<void> _kr_ensureSubscribeServiceInitialized() async {
|
||||
try {
|
||||
// 检查订阅服务状态
|
||||
final currentStatus = kr_subscribeService.kr_currentStatus.value;
|
||||
KRLogUtil.kr_i('订阅服务当前状态: $currentStatus', tag: 'SplashController');
|
||||
|
||||
if (currentStatus == KRSubscribeServiceStatus.kr_none ||
|
||||
currentStatus == KRSubscribeServiceStatus.kr_error) {
|
||||
KRLogUtil.kr_i(
|
||||
'订阅服务未初始化或错误,开始初始化', tag: 'SplashController');
|
||||
|
||||
// 初始化订阅服务并等待完成
|
||||
// 设置加载状态
|
||||
KRHomeController().kr_currentListStatus.value = KRHomeViewsListStatus.kr_loading;
|
||||
try {
|
||||
await kr_subscribeService.kr_refreshAll();
|
||||
KRLogUtil.kr_i('订阅服务初始化完成', tag: 'SplashController');
|
||||
} catch (error) {
|
||||
KRLogUtil.kr_e('订阅服务初始化失败: $error', tag: 'SplashController');
|
||||
// 重新抛出异常,让调用方知道初始化失败
|
||||
KRHomeController().kr_currentListStatus.value = KRHomeViewsListStatus.kr_error;
|
||||
rethrow;
|
||||
}
|
||||
} else if (currentStatus == KRSubscribeServiceStatus.kr_loading) {
|
||||
KRLogUtil.kr_i('订阅服务正在初始化中', tag: 'SplashController');
|
||||
// 如果正在加载中,等待加载完成
|
||||
while (kr_subscribeService.kr_currentStatus.value == KRSubscribeServiceStatus.kr_loading) {
|
||||
await Future.delayed(Duration(milliseconds: 100));
|
||||
}
|
||||
KRLogUtil.kr_i('订阅服务加载完成,最终状态: ${kr_subscribeService.kr_currentStatus.value}', tag: 'SplashController');
|
||||
KRHomeController().kr_currentListStatus.value = KRHomeViewsListStatus.kr_loading;
|
||||
} else if (currentStatus == KRSubscribeServiceStatus.kr_success) {
|
||||
KRHomeController().kr_currentListStatus.value = KRHomeViewsListStatus.kr_none;
|
||||
KRLogUtil.kr_i('订阅服务已成功初始化', tag: 'SplashController');
|
||||
}
|
||||
} catch (e) {
|
||||
KRLogUtil.kr_e('确保订阅服务初始化失败: $e', tag: 'SplashController');
|
||||
KRHomeController().kr_currentListStatus.value = KRHomeViewsListStatus.kr_error;
|
||||
rethrow;
|
||||
}
|
||||
}
|
||||
|
||||
// 重试按钮点击事件
|
||||
void kr_retry() {
|
||||
kr_hasError.value = false;
|
||||
@@ -749,15 +576,15 @@ class KRSplashController extends GetxController {
|
||||
/// 防止旧的测试账号在新安装时被恢复
|
||||
Future<void> _kr_clearOldLocalData() async {
|
||||
try {
|
||||
KRLogUtil.kr_i('🧹 开始清理旧本地存储数据...', tag: 'SplashController');
|
||||
// KRLogUtil.kr_i('🧹 开始清理旧本地存储数据...', tag: 'SplashController');
|
||||
|
||||
// 清理用户信息存储
|
||||
await KRSecureStorage().kr_deleteData(key: 'USER_INFO');
|
||||
KRLogUtil.kr_i('✅ 已清理USER_INFO', tag: 'SplashController');
|
||||
// KRLogUtil.kr_i('✅ 已清理USER_INFO', tag: 'SplashController');
|
||||
|
||||
// 清理设备登录状态
|
||||
await KRSecureStorage().kr_deleteData(key: 'DEVICE_INFO');
|
||||
KRLogUtil.kr_i('✅ 已清理DEVICE_INFO', tag: 'SplashController');
|
||||
// KRLogUtil.kr_i('✅ 已清理DEVICE_INFO', tag: 'SplashController');
|
||||
|
||||
KRLogUtil.kr_i('✅ 旧本地存储数据已全部清理', tag: 'SplashController');
|
||||
} catch (e) {
|
||||
@@ -775,4 +602,4 @@ class KRSplashController extends GetxController {
|
||||
void onClose() {
|
||||
super.onClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user