From fbc96b3e601c6cfe42d02adba860e46d03c1349e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 23 Mar 2021 18:27:45 +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 --- Rpc/Service.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Rpc/Service.php b/Rpc/Service.php index efecb38e..f70830c5 100644 --- a/Rpc/Service.php +++ b/Rpc/Service.php @@ -95,18 +95,17 @@ class Service extends Component public static function replace(Request $request, array $service): Request { if (!is_array($body = $request->params->getBodyAndClear())) { - var_dump($body); throw new Exception('Protocol format error.'); } - if (!isset($serialize['cmd'])) { + if (!isset($body['cmd'])) { throw new Exception('Protocol format error.'); } - $request->params->setPosts($serialize); + $request->params->setPosts($body); - $serialize['cmd'] = ltrim($serialize['cmd'], '/'); + $body['cmd'] = ltrim($body['cmd'], '/'); $header = $request->headers; - $header->replace('request_uri', 'rpc/p' . $service['port'] . '/' . $serialize['cmd']); + $header->replace('request_uri', 'rpc/p' . $service['port'] . '/' . $body['cmd']); $header->replace('request_method', Request::HTTP_CMD); return $request;