From 31e79f88a3af6d98bd34333c400a16bbdc7b81be Mon Sep 17 00:00:00 2001 From: aixianling Date: Thu, 16 Feb 2023 17:06:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=93=E5=8C=85=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/oms/apps/develop/AppDeployCustom/list.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/project/oms/apps/develop/AppDeployCustom/list.vue b/project/oms/apps/develop/AppDeployCustom/list.vue index fc0d5edb..188a17b5 100644 --- a/project/oms/apps/develop/AppDeployCustom/list.vue +++ b/project/oms/apps/develop/AppDeployCustom/list.vue @@ -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() {