From 2e5eb6bec4511d872b928bf2d8c976087b6be510 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Tue, 5 Nov 2024 11:50:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=9B=E5=BB=BA=E4=BC=9A=E8=AF=9D,=20?= =?UTF-8?q?=E6=B2=A1=E6=9C=89user=20ID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useConversation.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hooks/useConversation.js b/src/hooks/useConversation.js index 24dbd91..3c22546 100644 --- a/src/hooks/useConversation.js +++ b/src/hooks/useConversation.js @@ -1,3 +1,4 @@ +import useAuthStore from '@/stores/AuthStore'; import useConversationStore from '@/stores/ConversationStore'; import { fetchConversationsList, fetchOrderConversationsList, postNewOrEditConversationItem } from '@/actions/ConversationActions'; import { isEmpty } from '@/utils/commons'; @@ -8,6 +9,7 @@ export function useConversationNewItem() { ]); const conversationsList = useConversationStore((state) => state.conversationsList); const addToConversationList = useConversationStore((state) => state.addToConversationList); + const userId = useAuthStore((state) => state.loginUser.userId); /** * 打开订单的会话, 不存在自动新增 */ @@ -47,7 +49,7 @@ export function useConversationNewItem() { guest_phone: body.phone_number || '', guest_name: body.name || '', } - const createdNew = await postNewOrEditConversationItem({ ...newChat, opisn, conversationid }); + const createdNew = await postNewOrEditConversationItem({ ...newChat, opi_sn: opisn || userId, conversationid }); // addToConversationList([{...createdNew, sn: createdNew.conversationid}]); const _list = await fetchConversationsList({ opisn }); addToConversationList(_list);