diff --git a/src/pages/ChatMain/ChatMainList/index.vue b/src/pages/ChatMain/ChatMainList/index.vue index 4e22e70..60f2180 100644 --- a/src/pages/ChatMain/ChatMainList/index.vue +++ b/src/pages/ChatMain/ChatMainList/index.vue @@ -873,6 +873,11 @@ const sendMessage = async (message, isInstruct = false) => { await checkToken(); + /// 切换到对话tab + if (tabIndex.value !== 1) { + tabIndex.value = 1; + } + // 检查WebSocket连接状态,如果未连接,尝试重新连接 if (!isWsConnected()) { console.log("WebSocket未连接,尝试重新连接..."); diff --git a/src/pages/Discovery/index.vue b/src/pages/Discovery/index.vue index 00c2f02..7f1e764 100644 --- a/src/pages/Discovery/index.vue +++ b/src/pages/Discovery/index.vue @@ -23,7 +23,6 @@ import { onMounted, ref } from "vue"; import { SEND_MESSAGE_CONTENT_TEXT, SEND_MESSAGE_COMMAND_TYPE, SWITCH_TO_COMPANION_TAB } from "@/constant/constant"; import { navigateTo } from "@/router"; import { getAccessToken } from "@/constant/token"; -import { checkToken } from "@/hooks/useGoLogin"; import FindTabs from "./components/FindTabs/index.vue"; import CardSwiper from "./components/CardSwiper/index.vue"; @@ -122,8 +121,6 @@ const handleQuickQuestionClick = (item) => { }; const handleClick = async (item) => { - await checkToken(); - console.log(`执行点击事件: ${item.jumpType},参数:${JSON.stringify(item.jumpContent)}`); /// 商品 if (item.jumpType === JumpType.commodity) { @@ -133,7 +130,6 @@ const handleClick = async (item) => { } /// 提示词 else if (item.jumpType === JumpType.prompt) { - uni.$emit(SWITCH_TO_COMPANION_TAB); /// 切换到伴游tab uni.$emit(SEND_MESSAGE_CONTENT_TEXT, item.jumpContent); } /// 链接 @@ -145,7 +141,6 @@ const handleClick = async (item) => { } /// 组件指令 else if (item.jumpType === JumpType.command) { - uni.$emit(SWITCH_TO_COMPANION_TAB); /// 切换到伴游tab uni.$emit(SEND_MESSAGE_COMMAND_TYPE, { type: item.jumpContent, title: item.jumpDesc }); } }