diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/env/EnvChangeManager.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/env/EnvChangeManager.kt index ebbcc2ee06..a0058e016e 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/env/EnvChangeManager.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/env/EnvChangeManager.kt @@ -33,9 +33,7 @@ object EnvChangeManager { fun getCityName(): String { val cache = getConfig() return if (cache == null) { - val cityCode = CallerMapLocationListenerManager.getCurrentLocation()?.cityCode ?: SharedPrefsMgr.getInstance(Utils.getApp()).getString(SharedPrefsConstants.LOCATION_CITY_CODE) ?: "010" - updateCityCode(cityCode) - when(cityCode) { + when(CallerMapLocationListenerManager.getCurrentLocation()?.cityCode ?: SharedPrefsMgr.getInstance(Utils.getApp()).getString(SharedPrefsConstants.LOCATION_CITY_CODE) ?: "010") { "010" -> "北京" "0734" -> "衡阳" else -> "未知" @@ -51,17 +49,15 @@ object EnvChangeManager { fun getNetMode(): String { val cache = getConfig() - if (cache == null) { - val mode = DebugConfig.getNetMode() - updateNetMode(mode) - return when(mode) { + return if (cache == null) { + when(DebugConfig.getNetMode()) { DebugConfig.NET_MODE_RELEASE -> "生产" DebugConfig.NET_MODE_QA -> "测试" DebugConfig.NET_MODE_DEMO -> "演示" else -> "未知" } } else { - return when(cache.second) { + when(cache.second) { DebugConfig.NET_MODE_RELEASE -> "生产" DebugConfig.NET_MODE_QA -> "测试" DebugConfig.NET_MODE_DEMO -> "演示"