From b9c14e28f779296e44534844e0ece1e2b27eba82 Mon Sep 17 00:00:00 2001 From: gzydong Date: Thu, 3 Dec 2020 19:48:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Controller/WebSocketController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Controller/WebSocketController.php b/app/Controller/WebSocketController.php index c57caf0..35b8ff4 100644 --- a/app/Controller/WebSocketController.php +++ b/app/Controller/WebSocketController.php @@ -115,7 +115,8 @@ class WebSocketController implements OnMessageInterface, OnOpenInterface, OnClos // 判断是否为心跳检测 if ($frame->data == 'PING') return; - $result = SocketIOParser::decode($frame->data); + //$result = SocketIOParser::decode($frame->data); + $result = json_decode($frame->data,true); if (!isset(self::EVENTS[$result['event']])) { return; }