消息系统

This commit is contained in:
wxd
2024-10-02 12:27:58 +08:00
parent 0a273a24dc
commit dc004824b5
7 changed files with 36 additions and 21 deletions

View File

@@ -10,6 +10,7 @@ class MyWs {
this.reconnectionTime = null
}
linkWs(url) {
if(!(JSON.parse(getCookie("userInfo"))))return
if (this.ws && this.ws.readyState == 1) return
if(!this.wsUrl)this.wsUrl = url +`/${JSON.parse(getCookie("userInfo")).userId}`
this.ws = new WebSocket(this.wsUrl)