forked from github/dataease
fix: 路由地址增加问号导致websocket报错
This commit is contained in:
parent
b7286db7b4
commit
fffe3471bf
@ -36,12 +36,15 @@ export default {
|
|||||||
if (window.DataEaseBi?.baseUrl) {
|
if (window.DataEaseBi?.baseUrl) {
|
||||||
prefix = window.DataEaseBi.baseUrl
|
prefix = window.DataEaseBi.baseUrl
|
||||||
} else {
|
} else {
|
||||||
const href = window.location.href
|
// const href = window.location.href
|
||||||
prefix = href.substring(0, href.indexOf('#'))
|
prefix = location.origin + location.pathname
|
||||||
if (env.MODE === 'dev') {
|
if (env.MODE === 'dev') {
|
||||||
prefix = dev.server.proxy[basePath].target + '/'
|
prefix = dev.server.proxy[basePath].target + '/'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!prefix.endsWith('/')) {
|
||||||
|
prefix += '/'
|
||||||
|
}
|
||||||
const socket = new SockJS(prefix + 'websocket?userId=' + wsCache.get('user.uid'))
|
const socket = new SockJS(prefix + 'websocket?userId=' + wsCache.get('user.uid'))
|
||||||
stompClient = Stomp.over(socket)
|
stompClient = Stomp.over(socket)
|
||||||
const heads = {
|
const heads = {
|
||||||
|
Loading…
Reference in New Issue
Block a user