forked from github/dataease
Merge pull request #11843 from dataease/pr@dev-v2@fix_websocket
fix: 路由地址增加问号导致websocket报错
This commit is contained in:
commit
5ca4ed904a
@ -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 = {
|
||||
|
Loading…
Reference in New Issue
Block a user