This commit is contained in:
huangdeliang 2021-06-02 14:11:15 +08:00
parent cfe970bd45
commit a4252af6ed

View File

@ -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;