Skip to content

Commit b8fc67f

Browse files
committed
fix:添加数组的解析
1 parent 2355f98 commit b8fc67f

4 files changed

Lines changed: 14 additions & 18 deletions

File tree

.idea/sonarlint/issuestore/5/9/59ca5d84a1197004f62a9cb9f53a7df61157ac7a

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

FlowHttp/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ afterEvaluate {
1919
// 这里头是artifacts的配置信息,不填会采用默认的
2020
groupId = 'com.github.buhuiming'
2121
artifactId = 'NetCore-Flow'
22-
version = '1.6.8'
22+
version = '1.6.9'
2323

2424
from components.release
2525
artifact androidSourcesJar //打包源码,去除这行打的包将看不到源码

FlowHttp/src/main/java/com/bhm/network/core/GsonResponseBodyConverter.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,9 @@ class GsonResponseBodyConverter<T> internal constructor(
3737
}
3838
} catch (e: Exception) {
3939
when {
40-
dataArr != null && "[]" == dataArr.toString() -> {
40+
dataArr != null && "[]" == dataArr.toString() ||
41+
dataArr != null && dataArr.length() > 0 -> {
4142
//这种情况是一个空数组,但是声明的却不是一个数组
42-
jsonObject.put(dataKey, null)
43-
gson.fromJson(jsonObject.toString(), type)
44-
}
45-
dataArr != null && dataArr.length() > 0 -> {
46-
//这种情况是一个非空数组
4743
try {
4844
@Suppress("UNCHECKED_CAST")
4945
gson.fromJson<List<*>>(dataArr.toString(), type) as T

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
}
1111

1212
dependencies {
13-
implementation 'com.github.buhuiming:NetCore-Flow:1.6.7'
13+
implementation 'com.github.buhuiming:NetCore-Flow:1.6.9'
1414
}
1515

1616
#### 1、Application配置默认的全局配置项(可选)

0 commit comments

Comments
 (0)