From 5f407b0a81aab54d40054f78a581bd19471b1bf2 Mon Sep 17 00:00:00 2001 From: Lishiling Date: Sat, 21 Feb 2026 17:40:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=B0=9D=E8=AF=95=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/chat/StandaloneChat.vue | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/dashboard/src/components/chat/StandaloneChat.vue b/dashboard/src/components/chat/StandaloneChat.vue index 25ca7faf9..a5cd42952 100644 --- a/dashboard/src/components/chat/StandaloneChat.vue +++ b/dashboard/src/components/chat/StandaloneChat.vue @@ -90,10 +90,34 @@ const previewImageUrl = ref(''); const currSessionId = ref(''); const getCurrentSession = computed(() => null); // 独立测试模式不需要会话信息 +function buildWebchatUmo(sessionId: string): string { + const platformId = 'webchat'; + const messageType = 'FriendMessage'; + const username = localStorage.getItem('user') || 'guest'; + const sessionKey = `${platformId}!${username}!${sessionId}`; + return `${platformId}:${messageType}:${sessionKey}`; +} + +async function bindConfigToSession(sessionId: string) { + const confId = (props.configId || '').trim(); + if (!confId || confId === 'default') { + return; + } + + await axios.post('/api/config/umo_abconf_route/update', { + umo: buildWebchatUmo(sessionId), + conf_id: confId + }); +} + async function newSession() { try { const response = await axios.get('/api/chat/new_session'); const sessionId = response.data.data.session_id; + + // Bind the config before activating the session in the UI. + await bindConfigToSession(sessionId); + currSessionId.value = sessionId; return sessionId; } catch (err) {