优化好友和群聊新建会话逻辑。
This commit is contained in:
@@ -269,7 +269,12 @@
|
|||||||
|
|
||||||
// 新建会话
|
// 新建会话
|
||||||
const openNewChatModal = () => {
|
const openNewChatModal = () => {
|
||||||
console.log("点击了新建会话");
|
// 好友会话(1)或群聊(2)时,跳转到通讯录页面发起新聊天
|
||||||
|
if (chatType.value === 1 || chatType.value === 2) {
|
||||||
|
goContactPages()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// AI 聊天(0)时,弹出新建会话弹窗
|
||||||
emit('update:showNewChatModal', true)
|
emit('update:showNewChatModal', true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
8
unpackage/dist/dev/app-plus/app-service.js
vendored
8
unpackage/dist/dev/app-plus/app-service.js
vendored
@@ -149,7 +149,6 @@ if (uni.restoreGlobal) {
|
|||||||
if (res.statusCode === 200) {
|
if (res.statusCode === 200) {
|
||||||
const messagesInfo = res.data;
|
const messagesInfo = res.data;
|
||||||
if (messagesInfo) {
|
if (messagesInfo) {
|
||||||
formatAppLog("log", "at utils/cloud-api.js:98", "返回数据为", messagesInfo);
|
|
||||||
formatAppLog("log", "at utils/cloud-api.js:99", "工作区id为:", messagesInfo.workspace_id || "(无)");
|
formatAppLog("log", "at utils/cloud-api.js:99", "工作区id为:", messagesInfo.workspace_id || "(无)");
|
||||||
if (messagesInfo.workspace_id) {
|
if (messagesInfo.workspace_id) {
|
||||||
uni.setStorageSync("workspace_id", messagesInfo.workspace_id);
|
uni.setStorageSync("workspace_id", messagesInfo.workspace_id);
|
||||||
@@ -2700,7 +2699,10 @@ if (uni.restoreGlobal) {
|
|||||||
emit("select-chat");
|
emit("select-chat");
|
||||||
};
|
};
|
||||||
const openNewChatModal = () => {
|
const openNewChatModal = () => {
|
||||||
formatAppLog("log", "at components/ChatSidebar.vue:272", "点击了新建会话");
|
if (chatType.value === 1 || chatType.value === 2) {
|
||||||
|
goContactPages();
|
||||||
|
return;
|
||||||
|
}
|
||||||
emit("update:showNewChatModal", true);
|
emit("update:showNewChatModal", true);
|
||||||
};
|
};
|
||||||
const goContactPages = () => {
|
const goContactPages = () => {
|
||||||
@@ -2744,7 +2746,7 @@ if (uni.restoreGlobal) {
|
|||||||
const UserInfo = await getUserInfo(UserToken.value);
|
const UserInfo = await getUserInfo(UserToken.value);
|
||||||
UserAvatar.value = UserInfo.avatar || "";
|
UserAvatar.value = UserInfo.avatar || "";
|
||||||
UserName.value = UserInfo.username || "";
|
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() {
|
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;
|
return deleteConversation;
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ export const getConversationMessages = async (token, conversation_id, size, page
|
|||||||
if (res.statusCode === 200) {
|
if (res.statusCode === 200) {
|
||||||
const messagesInfo = res.data
|
const messagesInfo = res.data
|
||||||
if (messagesInfo) {
|
if (messagesInfo) {
|
||||||
console.log("返回数据为",messagesInfo);
|
// console.log("返回数据为",messagesInfo);
|
||||||
console.log("工作区id为:", messagesInfo.workspace_id || '(无)');
|
console.log("工作区id为:", messagesInfo.workspace_id || '(无)');
|
||||||
if (messagesInfo.workspace_id) {
|
if (messagesInfo.workspace_id) {
|
||||||
uni.setStorageSync('workspace_id', messagesInfo.workspace_id)
|
uni.setStorageSync('workspace_id', messagesInfo.workspace_id)
|
||||||
|
|||||||
Reference in New Issue
Block a user