NEZ-3294 fix:websocket 连接格式异常

This commit is contained in:
zhangyu
2023-10-30 13:51:05 +08:00
parent 498c88dc52
commit 791b1748eb
2 changed files with 5 additions and 2 deletions

View File

@@ -105,8 +105,11 @@ export default {
} else { } else {
baseUrl = baseUrl.replace('http://', 'ws://').replace('https://', 'ws://') baseUrl = baseUrl.replace('http://', 'ws://').replace('https://', 'ws://')
} }
if (!baseUrl.endsWith('/')) {
baseUrl += '/'
}
/// monitor /// monitor
const url = baseUrl + '/terminal/monitor.ws?' + '&token=' + token + '&uuid=' + this.obj.uuid const url = baseUrl + 'terminal/monitor.ws?' + '&token=' + token + '&uuid=' + this.obj.uuid
if (this.terminalSocket) { // 如果存在之前的链接 先断开 再链接新的 if (this.terminalSocket) { // 如果存在之前的链接 先断开 再链接新的
this.terminalSocket.close() this.terminalSocket.close()
} }

View File

@@ -61,7 +61,7 @@
</div> </div>
<div> <div>
<span>{{$t('asset.vendor')}}:</span> <span>{{$t('asset.vendor')}}:</span>
<span>{{n.vendor}}</span> <span>{{n.brand ? n.brand.name : ''}}</span>
</div> </div>
<div> <div>
<span>{{$t('overall.type')}}:</span> <span>{{$t('overall.type')}}:</span>