From a3bdaed4156e479d8e22867cd6445c25573edcd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=9D=B0?= Date: Wed, 1 Oct 2025 18:06:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=B8=93=E5=B1=9Etoken?= =?UTF-8?q?=E6=AC=A1=E6=95=B0=E6=9F=A5=E8=AF=A2=E9=80=BB=E8=BE=91=EF=BC=9B?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E6=A8=A1=E5=9E=8B=E6=97=B6=E9=83=BD=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E4=B8=80=E6=AC=A1=E6=AC=A1=E6=95=B0=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/chat.js | 3 ++- src/views/homePage.vue | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/store/chat.js b/src/store/chat.js index 530b349..32d8fbc 100644 --- a/src/store/chat.js +++ b/src/store/chat.js @@ -26,9 +26,10 @@ export const useChatStore = defineStore("chat", { }), actions: { async getUserCount() { + const activeTab = sessionStorage.getItem("activeTabAI"); const result = await getUserCountAPI({ token: localStorage.getItem("localToken"), - source: "1", + source: activeTab == 'deepNine' ? '2' : '1', }); this.UserCount = result.data; }, diff --git a/src/views/homePage.vue b/src/views/homePage.vue index caea394..8d4a4de 100644 --- a/src/views/homePage.vue +++ b/src/views/homePage.vue @@ -230,6 +230,9 @@ const setActiveTab = (tab, index, forceAIchat = false) => { setActiveTabIndex(index); console.log(tab, index, "tab, index"); setHeight(document.getElementById("testId")); // 给父组件发送窗口高度 + + // 在页面切换时获取最新的次数 + chatStore.getUserCount(); }; // 修改 activeComponent 的计算逻辑