This commit is contained in:
Zheng Jie
2022-05-24 18:30:25 +08:00
parent e11383a425
commit a0cfe3084e
2 changed files with 2 additions and 2 deletions

View File

@@ -4,4 +4,4 @@ ENV = 'production'
# 接口地址,注意协议,如果你没有配置 ssl需要将 https 改为 http
VUE_APP_BASE_API = '/'
# 如果接口是 http 形式, wss 需要改为 ws
VUE_APP_WS_API = '/'
VUE_APP_WS_API = 'wss://'

View File

@@ -147,7 +147,7 @@ export default {
})
},
initWebSocket() {
const wsUri = (process.env.VUE_APP_WS_API === '/' ? '/' : (process.env.VUE_APP_WS_API + '/')) + 'webSocket/deploy'
const wsUri = process.env.VUE_APP_WS_API + '/webSocket/deploy'
this.websock = new WebSocket(wsUri)
this.websock.onerror = this.webSocketOnError
this.websock.onmessage = this.webSocketOnMessage