Skip to content

Commit 4448f98

Browse files
committed
修复 Json 提交 Bean 类参数被解析成 String 类型的 Bug
1 parent 87bd11b commit 4448f98

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
* 博客地址:[网络请求,如斯优雅](https://www.jianshu.com/p/93cd59dec002)
66

7-
* [点击此处下载Demo](https://github.com/getActivity/EasyHttp/releases/download/10.5/EasyHttp.apk)
7+
* * 可以扫码下载 Demo 进行演示或者测试,如果扫码下载不了的,[点击此处下载Demo](https://github.com/getActivity/EasyHttp/releases/download/10.6/EasyHttp.apk)
88

99
![](picture/demo_code.png)
1010

@@ -54,7 +54,7 @@ android {
5454
5555
dependencies {
5656
// 网络请求框架:https://github.com/getActivity/EasyHttp
57-
implementation 'com.github.getActivity:EasyHttp:10.5'
57+
implementation 'com.github.getActivity:EasyHttp:10.6'
5858
// OkHttp 框架:https://github.com/square/okhttp
5959
// noinspection GradleDependency
6060
implementation 'com.squareup.okhttp3:okhttp:3.12.13'
@@ -67,7 +67,7 @@ dependencies {
6767

6868
| 功能或细节 | [EasyHttp](https://github.com/getActivity/EasyHttp) | [Retrofit](https://github.com/square/retrofit) | [OkGo](https://github.com/jeasonlzy/okhttp-OkGo) |
6969
| :----: | :------: | :-----: | :-----: |
70-
| 对应版本 | 10.5 | 2.9.0 | 3.0.4 |
70+
| 对应版本 | 10.6 | 2.9.0 | 3.0.4 |
7171
| issues 数 | [![](https://img.shields.io/github/issues/getActivity/EasyHttp.svg)](https://github.com/getActivity/EasyHttp/issues) | [![](https://img.shields.io/github/issues/square/retrofit.svg)](https://github.com/square/retrofit/issues) | [![](https://img.shields.io/github/issues/jeasonlzy/okhttp-OkGo.svg)](https://github.com/jeasonlzy/okhttp-OkGo/issues) |
7272
| **aar 包大小** | 78 KB | 123 KB | 131 KB |
7373
| minSdk 要求 | API 14+ | API 21+ | API 14+ |

app/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ android {
1313
applicationId 'com.hjq.easy.demo'
1414
minSdkVersion 16
1515
targetSdkVersion 31
16-
versionCode 1050
17-
versionName '10.5'
16+
versionCode 1060
17+
versionName '10.6'
1818
}
1919

2020
// 支持 JDK 1.8

library/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ android {
55

66
defaultConfig {
77
minSdkVersion 14
8-
versionCode 1050
9-
versionName "10.5"
8+
versionCode 1060
9+
versionName "10.6"
1010
}
1111

1212
// 使用 JDK 1.8

library/src/main/java/com/hjq/http/EasyUtils.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,9 @@ public static HashMap<String, Object> beanToHashMap(Object object) {
276276
return data;
277277
}
278278

279+
/**
280+
* 对象转换
281+
*/
279282
public static Object convertObject(Object object) {
280283
if (object instanceof List) {
281284
// 如果这是一个 List 参数
@@ -288,7 +291,7 @@ public static Object convertObject(Object object) {
288291
return String.valueOf(object);
289292
} else if (isBeanType(object)) {
290293
// 如果这是一个 Bean 参数
291-
return beanToHashMap(object);
294+
return mapToJsonObject(beanToHashMap(object));
292295
} else {
293296
// 如果这是一个普通的参数
294297
return object;

0 commit comments

Comments
 (0)