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 = {