From 2fad9b19fab0c450ca57157c9ecfd33d4eb4ad92 Mon Sep 17 00:00:00 2001 From: yxw <17074267@qq.com> Date: Fri, 1 Dec 2023 11:47:42 +0800 Subject: [PATCH] fix --- js/equalizer.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/equalizer.js b/js/equalizer.js index ef721ee..4f97803 100644 --- a/js/equalizer.js +++ b/js/equalizer.js @@ -62,6 +62,11 @@ $(function () { ws.onclose = function (e) { //当客户端收到服务端发送的关闭连接请求时,触发onclose事件 console.log("websocket已断开"); + setTimeout(() => { + console.log('重新连接') + // 重新连接 WebSocket + createWebSocket(); + }, 3000); } ws.onerror = function (e) { //如果出现连接、处理、接收、发送数据失败的时候触发onerror事件