commit
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user