Przeglądaj źródła

feat: 修改uid为string,登录IM成功

DoggyZhang 4 miesięcy temu
rodzic
commit
10d3a28a91

+ 10 - 11
frame/googleservice/build.gradle

@@ -10,10 +10,6 @@ ext {
     VERSION = '6.0.0'
 }
 
-if (project.FRAME_DEBUG != "true") {
-    apply from: "../../publish.gradle"
-}
-
 android {
     namespace 'com.adealink.frame.googleservice'
     compileSdk libs.versions.compileSdk.get().toInteger()
@@ -50,13 +46,16 @@ dependencies {
     implementation libs.gms.play.services.base
 
     //frame
-    compileOnly project(":frame:util")
-    compileOnly project(":frame:coroutine")
-    compileOnly project(":frame:zero")
-    compileOnly project(":frame:base")
-    compileOnly project(":frame:zero")
-    compileOnly project(":frame:data")
-    compileOnly project(":frame:log")
+    api platform(libs.frame.bom)
+    compileOnly libs.frame.util
+    compileOnly libs.frame.log
+    compileOnly libs.frame.zero
+    compileOnly libs.frame.base
+    compileOnly libs.frame.data
+    compileOnly libs.frame.coroutine
+    compileOnly libs.frame.util
+    compileOnly libs.frame.statistics
+    compileOnly libs.frame.storage
 
     //test
     testImplementation libs.junit

+ 1 - 1
frame/googleservice/src/main/java/com/adealink/frame/googleservice/IGoogleServiceConfig.kt

@@ -7,6 +7,6 @@ interface IGoogleServiceConfig {
 
     fun onGPReferrerFinished()
 
-    fun getUid(): Long
+    fun getUid(): String
 
 }

+ 23 - 22
frame/network/src/main/java/com/adealink/frame/network/ban/NetAntiBanManager.kt

@@ -145,28 +145,29 @@ internal class NetAntiBanManager(private val config: IAntiBanConfig) : BaseFrame
      * 刷新有效配置,按优先级选择:用户 > 国家 > 全局
      */
     private fun getMergeConfig(globalConfig: NetAntiBanConfig) : AntiBanConfig {
-        val uid = config.uid
-        // 查找匹配的用户配置
-        val userConfig = if (uid > 0) {
-            findUserConfig(globalConfig, uid)
-        } else {
-            null
-        }
-
-        val countryCode = config.countryCode
-        // 查找匹配的国家配置
-        val countryConfig = if (countryCode.isNotEmpty()) {
-            findCountryConfig(globalConfig, countryCode)
-        } else {
-            null
-        }
-        
-        // 合并配置,按优先级选择
-        val mergeConfig = AntiBanConfig.merge(globalConfig, countryConfig, userConfig)
-        if (AppBase.debugLog) {
-            AppBase.log.d(TAG_HTTP_ANTI_BAN, "getMergeConfig: uid=$uid, countryCode=$countryCode, mergeConfig=$mergeConfig")
-        }
-        return mergeConfig
+        // TODO: 防封禁
+//        val uid = config.uid
+//        // 查找匹配的用户配置
+//        val userConfig = if (uid > 0) {
+//            findUserConfig(globalConfig, uid)
+//        } else {
+//            null
+//        }
+//
+//        val countryCode = config.countryCode
+//        // 查找匹配的国家配置
+//        val countryConfig = if (countryCode.isNotEmpty()) {
+//            findCountryConfig(globalConfig, countryCode)
+//        } else {
+//            null
+//        }
+//
+//        // 合并配置,按优先级选择
+//        val mergeConfig = AntiBanConfig.merge(globalConfig, countryConfig, userConfig)
+//        if (AppBase.debugLog) {
+//            AppBase.log.d(TAG_HTTP_ANTI_BAN, "getMergeConfig: uid=$uid, countryCode=$countryCode, mergeConfig=$mergeConfig")
+//        }
+        return AntiBanConfig()
     }
     
     /**

+ 1 - 1
frame/network/src/main/java/com/adealink/frame/network/ban/config/IAntiBanConfig.kt

@@ -12,7 +12,7 @@ interface IAntiBanConfig {
     /**
      * 获取当前用户ID,用于用户级防封禁配置匹配
      */
-    val uid: Long
+    val uid: String
 
     /**
      * 获取当前用户所在国家代码,用于国家级防封禁配置匹配