From 386e8559396a9076b7fa4e8d2c5f18296ab0ed2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 24 Aug 2021 11:12:28 +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 --- http-helper/Route/Node.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/http-helper/Route/Node.php b/http-helper/Route/Node.php index 069042f9..9d6d7d19 100644 --- a/http-helper/Route/Node.php +++ b/http-helper/Route/Node.php @@ -79,12 +79,12 @@ class Node */ public function unpack(string $data): mixed { -// if ($this->_dataType == RpcProducer::PROTOCOL_JSON) { -// return json_decode($data, true); -// } -// if ($this->_dataType == RpcProducer::PROTOCOL_SERIALIZE) { -// return unserialize($data); -// } + if ($this->_dataType == 'json') { + return json_decode($data, true); + } + if ($this->_dataType == 'serializes') { + return unserialize($data); + } return $data; } @@ -93,7 +93,6 @@ class Node * @param $handler * @param $path * @return Node - * @throws NotFindClassException * @throws ReflectionException */ public function setHandler($handler, $path): static