add clear

This commit is contained in:
as2252258@163.com
2020-01-02 11:48:20 +08:00
parent 77a925ccc7
commit 70d0de22ef
+5 -1
View File
@@ -472,7 +472,11 @@ class HttpClient
return json_decode($body, true); return json_decode($body, true);
} else if (strpos($type, 'xml') !== false) { } else if (strpos($type, 'xml') !== false) {
$data = simplexml_load_string($body, 'SimpleXMLElement', LIBXML_NOCDATA); $data = simplexml_load_string($body, 'SimpleXMLElement', LIBXML_NOCDATA);
return json_decode(json_encode($data), TRUE); $encode = json_encode($data);
if (is_array($encode)) {
return $encode;
}
return json_decode($encode, TRUE);
} else if (strpos($type, 'plain') !== false) { } else if (strpos($type, 'plain') !== false) {
return json_decode($data, TRUE); return json_decode($data, TRUE);
} else { } else {