From 880db240593390d054f19e0b52b68046faf71356 Mon Sep 17 00:00:00 2001 From: lxm <1274844347@qq.com> Date: Thu, 30 Oct 2025 15:19:53 +0800 Subject: [PATCH] =?UTF-8?q?refactor(version=5Fupdate):=20=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E6=9C=AA=E4=BD=BF=E7=94=A8=E7=9A=84=E6=B8=A0=E9=81=93?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E5=B9=B6=E4=BC=98=E5=8C=96=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 注释掉未使用的_channel赋值 - 为iOS设备设置默认渠道 - 优化日志输出格式,添加开发者前缀 --- lib/data/services/version_update_service.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/data/services/version_update_service.dart b/lib/data/services/version_update_service.dart index 482da1069..e20b613f5 100644 --- a/lib/data/services/version_update_service.dart +++ b/lib/data/services/version_update_service.dart @@ -117,7 +117,7 @@ class VersionUpdateService extends GetxService { final platformInfo = await getCurrentPlatformInfo(); _platform = platformInfo.platform; - _channel = platformInfo.channel; + //_channel = platformInfo.channel; _lastCheckTime = DateTime.now(); // 调用后端接口获取最新版本信息 @@ -147,6 +147,7 @@ class VersionUpdateService extends GetxService { // 设置游客登录显示状态(先用当前渠道结果作为回退,再用.env渠道覆盖以保持一致) _isShowTourists = appInfo.tourists; + //print('lxm--_isShowTourists: $_isShowTourists'); if (Platform.isAndroid && _channel != platformInfo.channel) { //[4]当前渠道与.env渠道不同,需要从.env渠道获取游客登录配置 await _refreshTouristsFromEnv(); @@ -211,6 +212,7 @@ class VersionUpdateService extends GetxService { /// 获取当前平台信息 Future getCurrentPlatformInfo() async { if (Platform.isIOS) { + _channel = UserChannel.GLOBAL_APPLE; await _getIosDeviceBrand(); return const PlatformInfo( platform: 'ios', @@ -302,7 +304,7 @@ class VersionUpdateService extends GetxService { final envAppInfo = AppInfo.fromJson(resp['app']); _isShowTourists = envAppInfo.tourists; _logger.d( - '游客登录配置已按.env渠道同步: ${envAppInfo.tourists} (channel=$envChannelName)'); + 'lxm--游客登录配置已按.env渠道同步: ${envAppInfo.tourists} (channel=$envChannelName)'); } else { _logger.w('按.env渠道获取游客配置失败:响应为空或不含app字段'); }