From 7e4aa62593a61418c08ff7a8652af5183e210d85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Wed, 18 Nov 2020 14:56:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HttpServer/Client/ClientAbstracts.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/HttpServer/Client/ClientAbstracts.php b/HttpServer/Client/ClientAbstracts.php index cfc39dbe..de8ba9ae 100644 --- a/HttpServer/Client/ClientAbstracts.php +++ b/HttpServer/Client/ClientAbstracts.php @@ -8,6 +8,7 @@ use Closure; use Exception; use Snowflake\Abstracts\Component; use Snowflake\Core\Help; +use Snowflake\Core\JSON; use Swoole\Coroutine\System; @@ -599,6 +600,9 @@ abstract class ClientAbstracts extends Component implements IClient } else if (strpos($type, 'xml') !== false) { return Help::xmlToArray($body); } else if (strpos($type, 'plain') !== false) { + if (!is_null($json = JSON::decode($body))) { + return $json; + } return Help::toArray($body); } return $body;