wangyi
2026-03-03 fbe87c8d043cb038d384df7721bc071676a0c24c
utils/common.js
@@ -498,16 +498,24 @@
    httpFormatWs(httpUrl=this.serverUrl) {
        if(httpUrl.indexOf("http://") === 0){
            httpUrl = httpUrl.replace("http://", "")
            httpUrl = "ws://" + httpUrl.split(":")[0]+":8089/ws"
            httpUrl = httpUrl.substring(0, httpUrl.length - 1)
            let BackSlashLast = httpUrl.lastIndexOf('/')
            httpUrl = httpUrl.substring(0, BackSlashLast)
            httpUrl = "ws://" + httpUrl.split(":")[0]+":8888/ws"
        }else if(httpUrl.indexOf("https://") === 0) {
            httpUrl = httpUrl.replace("https://", "")
            httpUrl = "wss://" + httpUrl.split(":")[0]+":8089/ws"
            httpUrl = httpUrl.substring(0, httpUrl.length - 1)
            let BackSlashLast = httpUrl.lastIndexOf('/')
            httpUrl = httpUrl.substring(0, BackSlashLast)
            httpUrl = "wss://" + httpUrl.split(":")[0]+":8888/ws"
        }else{
            // 提示传入连接错误
        }
        
        return httpUrl
    }
}
export const CommonUtils = new commonUtils()