修复打包的问题

This commit is contained in:
aixianling
2023-02-16 17:06:48 +08:00
parent bc26d3af46
commit 31e79f88a3

View File

@@ -145,8 +145,8 @@ export default {
})
},
initWs() {
return !this.ws ? new Promise(resolve => {
this.ws = new WebSocket(`ws://localhost:12525/ws`)
return this.ws && this.ws.readyState == 1 ? Promise.resolve() : new Promise(resolve => {
this.ws = new WebSocket(`ws://192.168.1.87:12525/ws`)
this.ws.onopen = () => resolve()
this.ws.onmessage = res => {
if (this.$checkJson(res?.data)) {
@@ -173,7 +173,7 @@ export default {
this.ws.onerror = () => {
this.ws.close()
}
}) : Promise.resolve()
})
}
},
created() {