|
@@ -10,8 +10,6 @@ import com.benyanyi.okhttp.util.Internet;
|
|
|
import com.benyanyi.okhttp.util.InternetBean;
|
|
|
import com.benyanyi.okhttp.util.OkHttpLog;
|
|
|
import com.google.gson.Gson;
|
|
|
-import com.google.gson.JsonElement;
|
|
|
-import com.google.gson.JsonParser;
|
|
|
|
|
|
import org.json.XML;
|
|
|
|
|
@@ -163,7 +161,7 @@ class BeanCall<T> {
|
|
|
String str = message;
|
|
|
OkHttpLog.d(str);
|
|
|
String html = "<!DOCTYPE HTML>";
|
|
|
- if (FormatUtil.isNotEmpty(str) && !str.toUpperCase().contains(html)) {
|
|
|
+ if (FormatUtil.isNotEmpty(str) && !str.toUpperCase().contains(html) && isCache) {
|
|
|
if (FormatUtil.isNotEmpty(mCacheName)) {
|
|
|
CacheUtils.getInstance(context).setCacheToLocalJson(mCacheName, str);
|
|
|
}
|
|
@@ -210,13 +208,9 @@ class BeanCall<T> {
|
|
|
}
|
|
|
}
|
|
|
try {
|
|
|
- JsonParser jsonParser = new JsonParser();
|
|
|
- JsonElement parse = jsonParser.parse(str);
|
|
|
- if (parse.isJsonObject()) {
|
|
|
- t = new Gson().fromJson(str, tClass);
|
|
|
- } else {
|
|
|
- t = new Gson().fromJson(str, tClass);
|
|
|
- }
|
|
|
+// JsonParser jsonParser = new JsonParser();
|
|
|
+// JsonElement parse = jsonParser.parse(str);
|
|
|
+ t = new Gson().fromJson(str, tClass);
|
|
|
} catch (Exception e) {
|
|
|
OkHttpLog.e(e.getMessage());
|
|
|
}
|