From 28891234db96fb22583581494acf5b447b36edba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Wed, 13 Dec 2023 16:33:05 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96socket=E5=9C=B0?= =?UTF-8?q?=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Apps/ChatAi/components/ChitChat/index.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Apps/ChatAi/components/ChitChat/index.vue b/src/components/Apps/ChatAi/components/ChitChat/index.vue index 43f825bcd..1cd90e6e8 100644 --- a/src/components/Apps/ChatAi/components/ChitChat/index.vue +++ b/src/components/Apps/ChatAi/components/ChitChat/index.vue @@ -90,12 +90,12 @@ export default { }, methods: { initWebSocket() { - const { NODE_ENV, VUE_APP_KAEL_HOST } = process.env + const { NODE_ENV, VUE_APP_KAEL_HOST } = process.env || {} const api = '/kael/chat/system/' const protocol = window.location.protocol === 'https:' ? 'wss' : 'ws' const path = `${protocol}://${window.location.host}${api}` - const index = VUE_APP_KAEL_HOST.indexOf('://') - const localPath = protocol + VUE_APP_KAEL_HOST.substring(index, VUE_APP_KAEL_HOST.length) + api + const index = VUE_APP_KAEL_HOST?.indexOf('://') + const localPath = protocol + VUE_APP_KAEL_HOST?.substring(index, VUE_APP_KAEL_HOST?.length) + api const url = NODE_ENV === 'development' ? localPath : path createWebSocket(url, this.onWebSocketMessage) }, @@ -222,7 +222,7 @@ export default { .chat-list { flex: 1; position: relative; - padding: 0 15px; + padding: 0 15px 15px; overflow-y: auto; user-select: text; }