fix: bug

This commit is contained in:
yanghang
2025-06-30 15:08:51 +08:00
parent e1da68c59b
commit bb821fed27
2 changed files with 8 additions and 2 deletions
+5 -2
View File
@@ -15,10 +15,13 @@ export const useSocketStore = defineStore('socketStore',{
},
actions:{
creatSocket(){
let _baseUrl = get_base_url().split('http').join('ws')
console.log(_baseUrl)
if(this.SocketObj && this.SocketObj?.close) {
closeSocket()
this.closeSocket()
}
this.SocketObj = new SocketClass(get_base_url() + '/trastudy/trasoket/open?summary=' + getToken());
this.SocketObj = new SocketClass(_baseUrl + '/trastudy/trasoket/open?summary=' + getToken());
},
closeSocket: () => {
if(!this.SocketObj || !this.SocketObj?.close) return