|
@@ -22,13 +22,17 @@ class CustomBodyConverter<T>(private val type: Type) : Converter<ResponseBody, B
|
|
|
val respString = value.string()
|
|
|
|
|
|
val model = BaseResponse<T>()
|
|
|
- val jsonObject = JSONObject(respString)
|
|
|
/* model.code = jsonObject.getString("code")
|
|
|
jsonObject.remove("code")
|
|
|
model.message = jsonObject.getString("message")
|
|
|
jsonObject.remove("message")*/
|
|
|
model.code = "200"
|
|
|
|
|
|
+ if (respString == ""){
|
|
|
+ return model
|
|
|
+ }
|
|
|
+
|
|
|
+ val jsonObject = JSONObject(respString)
|
|
|
val result = jsonObject.toString()
|
|
|
if (!TextUtils.isEmpty(result) && !"null".equals(result, true)) {
|
|
|
model.mData = Gson().fromJson(result, this.type)
|