From a3c072fed3e2930a83cdc25d1aac8de4d814a41c Mon Sep 17 00:00:00 2001 From: renwj Date: Fri, 29 Jul 2022 20:05:25 +0800 Subject: [PATCH] =?UTF-8?q?[EnvChange]=E4=BC=98=E5=8C=96=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=85=A5=E5=8F=A3=E6=8C=81=E4=B9=85=E5=8C=96?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../env/EnvChangeManager.kt | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) 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 -> "演示"