This commit is contained in:
huangdeliang
2021-06-03 14:10:24 +08:00
parent 6238dffef0
commit 13cb91cd92
3 changed files with 6 additions and 4 deletions

View File

@ -39,6 +39,7 @@ function connect() {
ws.onerror = event => {
// console.log({ event });
ws.close();
ws = undefined;
window.removeEventListener("message", handleOnMessageReceive);
@ -56,6 +57,7 @@ function connect() {
} catch (error) {
// console.log(error);
// console.log("浏览器不支持websocket");
ws.close();
ws = undefined;
websocketInit();
}