From a4252af6ed90b91a8531c49cf22be3830a0c5ed9 Mon Sep 17 00:00:00 2001 From: huangdeliang Date: Wed, 2 Jun 2021 14:11:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dws?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- stdiet-ui/src/utils/websocket.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/stdiet-ui/src/utils/websocket.js b/stdiet-ui/src/utils/websocket.js index 1098bc150..93ef5146a 100644 --- a/stdiet-ui/src/utils/websocket.js +++ b/stdiet-ui/src/utils/websocket.js @@ -1,9 +1,7 @@ -import { getToken } from "./auth"; - const { protocol, hostname, origin, port } = window.location; const wsProtocol = protocol.startsWith("https") ? "wss" : "ws"; const url = `${wsProtocol}://${hostname}${ - port === "80" || port === "443" ? "" : `:${8091}` + hostname === "localhost" ? `:${8091}` : "" }/ws`; let ws = undefined; let intervalRef = undefined;