From b93b73b5f6a7e3bfa88137760da3706b534ec3ae Mon Sep 17 00:00:00 2001 From: Baobhan Sith <80159437+Heavrnl@users.noreply.github.com> Date: Fri, 25 Apr 2025 18:05:22 +0800 Subject: [PATCH] Update session.store.ts --- packages/frontend/src/stores/session.store.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/frontend/src/stores/session.store.ts b/packages/frontend/src/stores/session.store.ts index a60e51b..e43c5e0 100644 --- a/packages/frontend/src/stores/session.store.ts +++ b/packages/frontend/src/stores/session.store.ts @@ -374,7 +374,8 @@ export const useSessionStore = defineStore('session', () => { activeAndDisconnected = true; // 满足最高优先级:重连当前活动会话 console.log(`[SessionStore] 活动会话 ${activeSessionId.value} 已断开或出错,尝试重连...`); - const wsUrl = `ws://${window.location.hostname}:3001`; // TODO: 从配置获取 URL + const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'; + const wsUrl = `${protocol}//${window.location.hostname}/`; // 与 openNewSession 保持一致 currentActiveSession.wsManager.connect(wsUrl); } }