diff --git a/components/ChatSidebar.vue b/components/ChatSidebar.vue index ede9aec..b9553fb 100644 --- a/components/ChatSidebar.vue +++ b/components/ChatSidebar.vue @@ -269,7 +269,12 @@ // 新建会话 const openNewChatModal = () => { - console.log("点击了新建会话"); + // 好友会话(1)或群聊(2)时,跳转到通讯录页面发起新聊天 + if (chatType.value === 1 || chatType.value === 2) { + goContactPages() + return + } + // AI 聊天(0)时,弹出新建会话弹窗 emit('update:showNewChatModal', true) } diff --git a/unpackage/dist/dev/app-plus/app-service.js b/unpackage/dist/dev/app-plus/app-service.js index ef28837..ded8ba5 100644 --- a/unpackage/dist/dev/app-plus/app-service.js +++ b/unpackage/dist/dev/app-plus/app-service.js @@ -149,7 +149,6 @@ if (uni.restoreGlobal) { if (res.statusCode === 200) { const messagesInfo = res.data; if (messagesInfo) { - formatAppLog("log", "at utils/cloud-api.js:98", "返回数据为", messagesInfo); formatAppLog("log", "at utils/cloud-api.js:99", "工作区id为:", messagesInfo.workspace_id || "(无)"); if (messagesInfo.workspace_id) { uni.setStorageSync("workspace_id", messagesInfo.workspace_id); @@ -2700,7 +2699,10 @@ if (uni.restoreGlobal) { emit("select-chat"); }; const openNewChatModal = () => { - formatAppLog("log", "at components/ChatSidebar.vue:272", "点击了新建会话"); + if (chatType.value === 1 || chatType.value === 2) { + goContactPages(); + return; + } emit("update:showNewChatModal", true); }; const goContactPages = () => { @@ -2744,7 +2746,7 @@ if (uni.restoreGlobal) { const UserInfo = await getUserInfo(UserToken.value); UserAvatar.value = UserInfo.avatar || ""; UserName.value = UserInfo.username || ""; - formatAppLog("log", "at components/ChatSidebar.vue:328", "菜单收到的会话列表:", UserConversations.value); + formatAppLog("log", "at components/ChatSidebar.vue:333", "菜单收到的会话列表:", UserConversations.value); }); const __returned__ = { props, emit, UserConversations, showNewChatModal, chatType, openUserCardVisible, isSelectMode, selectedHistoryIds, deleteConversations, clearAllConversations, isAllHistorySelected, currentChatId, selectChat, openNewChatModal, goContactPages, chatHistoryQuery, isHistorySearchFocused, toggleSelectMode, toggleHistorySelect, toggleSelectAllHistory, UserToken, UserAvatar, UserName, truncateText, computed: vue.computed, onMounted: vue.onMounted, onUnmounted: vue.onUnmounted, ref: vue.ref, toRef: vue.toRef, get deleteConversation() { return deleteConversation; diff --git a/utils/cloud-api.js b/utils/cloud-api.js index 00f2bda..1a65c1d 100644 --- a/utils/cloud-api.js +++ b/utils/cloud-api.js @@ -95,7 +95,7 @@ export const getConversationMessages = async (token, conversation_id, size, page if (res.statusCode === 200) { const messagesInfo = res.data if (messagesInfo) { - console.log("返回数据为",messagesInfo); + // console.log("返回数据为",messagesInfo); console.log("工作区id为:", messagesInfo.workspace_id || '(无)'); if (messagesInfo.workspace_id) { uni.setStorageSync('workspace_id', messagesInfo.workspace_id)