|
|
@@ -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()
|
|
|
}
|
|
|
|
|
|
/**
|