From fc24043cef5ea4d0dd47c62b235fbf5a0d6144c8 Mon Sep 17 00:00:00 2001 From: yangyakun Date: Wed, 9 Jul 2025 18:59:02 +0800 Subject: [PATCH] =?UTF-8?q?[8.1.2]=20[fix]=20[HttpHeaderInterceptor?= =?UTF-8?q?=E9=99=8D=E9=A2=91=20=E5=8E=BB=E6=8E=89Delegates.observable]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../startup/stageone/HttpDnsStartUp.kt | 35 +++++++++++-------- gradle.properties | 16 ++++----- 2 files changed, 28 insertions(+), 23 deletions(-) diff --git a/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/HttpDnsStartUp.kt b/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/HttpDnsStartUp.kt index dd58db5d7e..4789cf01af 100644 --- a/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/HttpDnsStartUp.kt +++ b/core/function-impl/mogo-core-function-startup/src/main/java/com/mogo/eagle/core/function/startup/stageone/HttpDnsStartUp.kt @@ -75,17 +75,7 @@ class HttpDnsStartUp : AndroidStartup(), IMoGoCloudListener { @Volatile private var gotToken = false - private var httpDnsSimpleLocation by Delegates.observable(getDefaultSimpleLocation()) { _, oldValue, newValue -> - if (gotToken && oldValue.cityCode != newValue.cityCode) { - if (handler.hasMessages(1)) { - handler.removeMessages(1) - } - val msg = Message.obtain() - msg.what = 1 - msg.obj = Pair(oldValue.cityCode, newValue.cityCode) - handler.sendMessageDelayed(msg, 1000L * 10) - } - } + private var httpDnsSimpleLocation = getDefaultSimpleLocation() override fun callCreateOnMainThread() = true @@ -190,8 +180,8 @@ class HttpDnsStartUp : AndroidStartup(), IMoGoCloudListener { val envConfig = CallerDevaToolsManager.getEnvConfig() if (envConfig != null) { // 更新 - httpDnsSimpleLocation = - SimpleLocation(envConfig.cityCode, envConfig.lat, envConfig.lon) + checkCityCode(envConfig.cityCode) + httpDnsSimpleLocation = SimpleLocation(envConfig.cityCode, envConfig.lat, envConfig.lon) return httpDnsSimpleLocation } val mogoLocation: MogoLocation = @@ -202,13 +192,16 @@ class HttpDnsStartUp : AndroidStartup(), IMoGoCloudListener { mogoLocation.cityCode.isNullOrEmpty() && !CallerMapUIServiceManager.getGDLocationServer()?.lastCityCode.isNullOrEmpty() ) { + val cityCode = (CallerMapUIServiceManager.getGDLocationServer()?.lastCityCode + ?: "010") + checkCityCode(cityCode) SimpleLocation( - CallerMapUIServiceManager.getGDLocationServer()?.lastCityCode - ?: "010", + cityCode, mogoLocation.latitude, mogoLocation.longitude ) } else { + checkCityCode(mogoLocation.cityCode) SimpleLocation( mogoLocation.cityCode, mogoLocation.latitude, @@ -222,6 +215,18 @@ class HttpDnsStartUp : AndroidStartup(), IMoGoCloudListener { initAiCloudSDK() } + private fun checkCityCode(cityCode: String) { + if (gotToken && cityCode != httpDnsSimpleLocation.cityCode) { + if (handler.hasMessages(1)) { + handler.removeMessages(1) + } + val msg = Message.obtain() + msg.what = 1 + msg.obj = Pair(httpDnsSimpleLocation.cityCode, cityCode) + handler.sendMessageDelayed(msg, 1000L * 10) + } + } + @ChainLog( linkChainLog = CHAIN_TYPE_STATUS, linkCode = CHAIN_SOURCE_CLOUD, diff --git a/gradle.properties b/gradle.properties index 9d6f088e4a..c169035b1b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -64,21 +64,21 @@ bytex.ASM_API=ASM7 LOGLIB_VERSION=1.10.18 ######## MogoAiCloudSDK Version ######## # 网络请求LOGLIB_VERSION -MOGO_NETWORK_VERSION=1.4.7.58 +MOGO_NETWORK_VERSION=1.4.7.65 # 鉴权 -MOGO_PASSPORT_VERSION=1.4.7.63 +MOGO_PASSPORT_VERSION=1.4.7.65 # 长链接 -MOGO_SOCKET_VERSION=1.4.7.58 +MOGO_SOCKET_VERSION=1.4.7.65 # 数据采集 -MOGO_REALTIME_VERSION=1.4.7.58 +MOGO_REALTIME_VERSION=1.4.7.65 # 直播推流 -MOGO_LIVE_VERSION=1.4.7.58 +MOGO_LIVE_VERSION=1.4.7.65 # 直播拉流 -MOGO_TRAFFICLIVE_VERSION=1.4.7.58 +MOGO_TRAFFICLIVE_VERSION=1.4.7.65 # 定位服务 -MOGO_LOCATION_VERSION=1.4.7.58 +MOGO_LOCATION_VERSION=1.4.7.65 # 远程通讯模块 -MOGO_TELEMATIC_VERSION=1.4.7.58 +MOGO_TELEMATIC_VERSION=1.4.7.65 # 动态换肤SDK MOGO_SKIN_VERSION=1.4.7.50 ######## MogoAiCloudSDK Version ########