From f68245624113bfbb04dccda0e2f6f889a85f4733 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B9=98=E9=A3=8E?= Date: Fri, 16 Jan 2026 18:16:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=BC=BACustomerList=E5=92=8CMessageL?= =?UTF-8?q?ist=E7=BB=84=E4=BB=B6=E7=9A=84=E9=94=99=E8=AF=AF=E5=A4=84?= =?UTF-8?q?=E7=90=86=EF=BC=9A=E5=9C=A8CustomerList=E4=B8=AD=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E9=94=99=E8=AF=AF=E6=97=A5=E5=BF=97=E5=92=8C=E9=99=8D?= =?UTF-8?q?=E7=BA=A7=E9=80=BB=E8=BE=91=E4=BB=A5=E5=A4=84=E7=90=86=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E5=A4=B1=E8=B4=A5=E6=83=85=E5=86=B5=EF=BC=9B=E5=9C=A8?= =?UTF-8?q?MessageList=E4=B8=AD=E4=BC=98=E5=8C=96=E8=AD=A6=E5=91=8A?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E4=BB=A5=E7=A1=AE=E4=BF=9D=E6=9B=B4=E5=87=86?= =?UTF-8?q?=E7=A1=AE=E7=9A=84=E8=B0=83=E8=AF=95=E4=BF=A1=E6=81=AF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ckbox/weChat/components/CustomerList/index.tsx | 9 ++++++++- .../components/SidebarMenu/MessageList/index.tsx | 12 +++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/pages/pc/ckbox/weChat/components/CustomerList/index.tsx b/src/pages/pc/ckbox/weChat/components/CustomerList/index.tsx index e3eb8fe..f2b3046 100644 --- a/src/pages/pc/ckbox/weChat/components/CustomerList/index.tsx +++ b/src/pages/pc/ckbox/weChat/components/CustomerList/index.tsx @@ -25,7 +25,14 @@ const CustomerList: React.FC = () => { } setLoading(false); }) - .catch(() => { + .catch(error => { + console.error("❌ 获取客服列表失败:", error); + // 即使加载失败,也设置为 null(表示"全部"),避免阻塞会话列表 + const current = useCustomerStore.getState().currentCustomer; + if (current === undefined) { + console.log("🔄 加载失败,降级为全部账号"); + updateCurrentCustomer(null); + } setLoading(false); }); }, []); diff --git a/src/pages/pc/ckbox/weChat/components/SidebarMenu/MessageList/index.tsx b/src/pages/pc/ckbox/weChat/components/SidebarMenu/MessageList/index.tsx index 5971318..3b773a8 100644 --- a/src/pages/pc/ckbox/weChat/components/SidebarMenu/MessageList/index.tsx +++ b/src/pages/pc/ckbox/weChat/components/SidebarMenu/MessageList/index.tsx @@ -113,7 +113,17 @@ const MessageList: React.FC = () => { // 调试日志:检查会话列表状态 useEffect(() => { - if (displaySessions.length === 0) { + // 只在以下情况才警告: + // 1. 会话列表为空 + // 2. 已经完成过至少一次加载 + // 3. currentCustomer 不是 undefined(已加载客服列表) + // 4. 不在同步中 + if ( + displaySessions.length === 0 && + hasLoadedOnce && + currentCustomer !== undefined && + !syncing + ) { console.warn("⚠️ 会话列表为空,调试信息:", { storeSessionsLength: storeSessions.length, filteredSessionsLength: filteredSessions.length,