From ad346d01d104fbec2f958db3103b17b0869a255b Mon Sep 17 00:00:00 2001 From: xl Date: Wed, 4 May 2022 03:29:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RpcJsonp.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/RpcJsonp.php b/RpcJsonp.php index 90f527e..12046f7 100644 --- a/RpcJsonp.php +++ b/RpcJsonp.php @@ -191,8 +191,9 @@ class RpcJsonp extends Component implements OnConnectInterface, OnReceiveInterfa for ($i = 0; $i < $total; $i++) { $result[] = $channel->pop(); } + $result = json_encode($result, JSON_UNESCAPED_UNICODE); } - $server->send($fd, json_encode($result, JSON_UNESCAPED_UNICODE)); + $server->send($fd, $result); } @@ -229,11 +230,9 @@ class RpcJsonp extends Component implements OnConnectInterface, OnReceiveInterfa $data['service'] = '/' . $data['service']; } $handler = $this->collector->find($data['service'], 'GET'); - var_dump($handler, $data); if (is_integer($handler) || is_null($handler)) { throw new Exception('Handler not found', -32601); } - $controller = $this->container->get($handler->callback[0]); if (!method_exists($controller, $data['method'])) { throw new Exception('Method not found', -32601);