Browse Source

refactor(version_update): 移除未使用的渠道变量并优化日志输出

- 注释掉未使用的_channel赋值
- 为iOS设备设置默认渠道
- 优化日志输出格式,添加开发者前缀
newdev_shunjiawei
lxm 12 months ago
parent
commit
1040dc2b99
  1. 6
      lib/data/services/version_update_service.dart

6
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<PlatformInfo> 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字段');
}

Loading…
Cancel
Save