修复打包的问题
This commit is contained in:
@@ -145,8 +145,8 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
initWs() {
|
initWs() {
|
||||||
return !this.ws ? new Promise(resolve => {
|
return this.ws && this.ws.readyState == 1 ? Promise.resolve() : new Promise(resolve => {
|
||||||
this.ws = new WebSocket(`ws://localhost:12525/ws`)
|
this.ws = new WebSocket(`ws://192.168.1.87:12525/ws`)
|
||||||
this.ws.onopen = () => resolve()
|
this.ws.onopen = () => resolve()
|
||||||
this.ws.onmessage = res => {
|
this.ws.onmessage = res => {
|
||||||
if (this.$checkJson(res?.data)) {
|
if (this.$checkJson(res?.data)) {
|
||||||
@@ -173,7 +173,7 @@ export default {
|
|||||||
this.ws.onerror = () => {
|
this.ws.onerror = () => {
|
||||||
this.ws.close()
|
this.ws.close()
|
||||||
}
|
}
|
||||||
}) : Promise.resolve()
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|||||||
Reference in New Issue
Block a user