From fffe3471bf2dba527f2be98da0c5a533031a87de Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 29 Aug 2024 15:14:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B7=AF=E7=94=B1=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=97=AE=E5=8F=B7=E5=AF=BC=E8=87=B4websocket?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core-frontend/src/websocket/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/core-frontend/src/websocket/index.ts b/core/core-frontend/src/websocket/index.ts index e14e82f910..583e26e553 100644 --- a/core/core-frontend/src/websocket/index.ts +++ b/core/core-frontend/src/websocket/index.ts @@ -36,12 +36,15 @@ export default { if (window.DataEaseBi?.baseUrl) { prefix = window.DataEaseBi.baseUrl } else { - const href = window.location.href - prefix = href.substring(0, href.indexOf('#')) + // const href = window.location.href + prefix = location.origin + location.pathname if (env.MODE === 'dev') { prefix = dev.server.proxy[basePath].target + '/' } } + if (!prefix.endsWith('/')) { + prefix += '/' + } const socket = new SockJS(prefix + 'websocket?userId=' + wsCache.get('user.uid')) stompClient = Stomp.over(socket) const heads = {