wss问题

This commit is contained in:
wanggeng 2024-05-27 21:48:46 +08:00
parent b76f6322c8
commit 464d5a34b0

View File

@ -45,13 +45,9 @@ export function websocketUrl() {
}
const location = window.location;
const protocol = location.protocol;
console.log(protocol);
let wsProtocol = 'ws';
if (protocol == 'https') {
wsProtocol = 'wss';
}
const wsProtocol = protocol.replace('https:', 'wss:').replace('http:', 'ws:')
console.log(wsProtocol);
return `${wsProtocol}://${location.host}${WebSocketBaseUrl}`;
return `${wsProtocol}//${location.host}${WebSocketBaseUrl}`;
}
export function downloadUrl(fileId: string, isDownload?: boolean) {