mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-10-10 19:36:36 +08:00
修复ws连接问题
This commit is contained in:
@@ -114,8 +114,8 @@ export default function NodePage() {
|
|||||||
closeWebSocket();
|
closeWebSocket();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 构建WebSocket URL,将HTTP协议转换为WS协议
|
// 构建WebSocket URL,使用与API相同的地址逻辑
|
||||||
let baseUrl = import.meta.env.VITE_API_BASE || 'http://localhost:8080';
|
let baseUrl = import.meta.env.VITE_API_BASE || window.location.origin;
|
||||||
const wsUrl = baseUrl.replace(/^http/, 'ws') + `/system-info?type=0&secret=${localStorage.getItem('token')}`;
|
const wsUrl = baseUrl.replace(/^http/, 'ws') + `/system-info?type=0&secret=${localStorage.getItem('token')}`;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user