feat: ws连接
This commit is contained in:
@@ -37,10 +37,12 @@ class WebSocketManager {
|
||||
}
|
||||
|
||||
// 根据当前页面协议自动选择 ws 或 wss
|
||||
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'
|
||||
// const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'
|
||||
const protocol = 'wss:'
|
||||
|
||||
// 从环境变量获取 WebSocket 主机地址
|
||||
const wsHost = import.meta.env.VITE_WS_HOST || '18.167.251.121:10094'
|
||||
// const wsHost = import.meta.env.VITE_WS_HOST || '18.167.251.121:10094'
|
||||
const wsHost = 'www.develop-ms.api.aida.com.hk'
|
||||
|
||||
this.url = `${protocol}//${wsHost}/ws?token=${token}`
|
||||
this.isManualClose = false
|
||||
|
||||
Reference in New Issue
Block a user