[EnvChange]优化环境配置入口持久化逻辑
This commit is contained in:
@@ -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 -> "演示"
|
||||
|
||||
Reference in New Issue
Block a user