优化好友和群聊新建会话逻辑。

This commit is contained in:
2026-08-05 17:56:12 +08:00
parent 941070a2ee
commit b4e69802c0
3 changed files with 12 additions and 5 deletions

View File

@@ -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)
}

View File

@@ -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;

View File

@@ -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)