fix: 打包错误信息处理

This commit is contained in:
yanghang
2025-07-01 14:42:57 +08:00
parent ad2a9449bd
commit 1d1288539e
6 changed files with 113 additions and 62 deletions
+4 -4
View File
@@ -19,11 +19,11 @@ export const useSocketStore = defineStore('socketStore',{
if(this.SocketObj && this.SocketObj?.close) return
this.SocketObj = new SocketClass(_baseUrl + '/trastudy/trasoket/open?summary=' + getToken());
},
closeSocket: () => {
if(!this.SocketObj || !this.SocketObj?.close) return
this.SocketObj && this.SocketObj?.close?.()
closeSocket() {
if(!(this.SocketObj && this.SocketObj?.close)) return
this.SocketObj && this.SocketObj.close()
},
setOnmessageCb: (cb) => {
setOnmessageCb(cb){
if(!this.SocketObj || !this.SocketObj?.on) return
this.SocketObj.on('message', cb)
}