This commit is contained in:
2025-12-09 09:58:25 +08:00
parent ade83bf8d5
commit 7e4fd94817
44 changed files with 1548 additions and 774 deletions
@@ -149,8 +149,8 @@
}
connect() {
//const WS_URL = window.location.host + "${base}/websocket"
const WS_URL = 'zhgh.jshvc.edu.cn' + "${base}/websocket"
const WS_URL = window.location.host + "${base}/websocket"
// const WS_URL = 'zhgh.jshvc.edu.cn' + "${base}/websocket"
const protocol = window.location.protocol === "http:" ? "ws://" : "wss://"
this.ws = new WebSocket(protocol + WS_URL)
}
@@ -163,7 +163,6 @@
this.subscribers.get(type).add(callback)
setTimeout(() => {
console.log(this.ws.readyState)
// 所有订阅完成后,发送 join 消息
if (!this.isSubscribed && this.ws.readyState === WebSocket.OPEN) {
this.isSubscribed = true