Merge pull request #11843 from dataease/pr@dev-v2@fix_websocket

fix: 路由地址增加问号导致websocket报错
This commit is contained in:
fit2cloud-chenyw 2024-08-29 15:15:55 +08:00 committed by GitHub
commit 5ca4ed904a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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