From ddb9f981745ff81560358e4380b52ba7a3c51e59 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Tue, 19 Mar 2024 13:49:27 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=80=E5=87=BA=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/ConversationStore.js | 14 ++++++++++---- src/views/dingding/Logout.jsx | 11 +++++++---- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/stores/ConversationStore.js b/src/stores/ConversationStore.js index 6ec6d36..f171ec5 100644 --- a/src/stores/ConversationStore.js +++ b/src/stores/ConversationStore.js @@ -32,12 +32,16 @@ const initialConversationState = { // templates: [], - // conversationsList: [], // 对话列表 - // currentConversation: {}, // 当前对话 + conversationsList: [], // 对话列表 + currentConversation: {}, // 当前对话 - // activeConversations: {}, // 激活的对话的消息列表: { [conversationId]: [] } + activeConversations: {}, // 激活的对话的消息列表: { [conversationId]: [] } - // referenceMsg: {}, + referenceMsg: {}, + complexMsg: {}, + + totalNotify: 0, + msgListLoading: false, }; @@ -345,6 +349,8 @@ export const useConversationStore = create( setInitial(true); }, + + reset: () => set(initialConversationState), })) ); diff --git a/src/views/dingding/Logout.jsx b/src/views/dingding/Logout.jsx index ba32162..671b3a4 100644 --- a/src/views/dingding/Logout.jsx +++ b/src/views/dingding/Logout.jsx @@ -1,4 +1,5 @@ import useAuthStore from '@/stores/AuthStore' +import useConversationStore from '@/stores/ConversationStore' import { Flex, Result, Spin, Typography } from 'antd' import { useEffect } from 'react' import { useNavigate } from 'react-router-dom' @@ -7,11 +8,13 @@ import { useNavigate } from 'react-router-dom' function Logout() { const navigate = useNavigate() - - const { logout } = useAuthStore() + + const logout = useAuthStore(state => state.logout) + const reset = useConversationStore((state) => state.reset); useEffect(() => { - logout() + logout() + reset(); navigate('/p/dingding/qrcode') }, []) @@ -29,4 +32,4 @@ function Logout() { ) } -export default Logout \ No newline at end of file +export default Logout