diff --git a/Cunkebao/src/pages/login/Login.tsx b/Cunkebao/src/pages/login/Login.tsx index d375422a..972710b2 100644 --- a/Cunkebao/src/pages/login/Login.tsx +++ b/Cunkebao/src/pages/login/Login.tsx @@ -7,6 +7,7 @@ import { UserOutline, } from "antd-mobile-icons"; import { useUserStore } from "@/store/module/user"; +import { useWebSocketStore } from "@/store/module/websocket/websocket"; import { loginWithPassword, loginWithCode, sendVerificationCode } from "./api"; import style from "./login.module.scss"; @@ -75,6 +76,8 @@ const Login: React.FC = () => { response.then(res => { const { member, kefuData, deviceTotal } = res; + // 清空WebSocket连接状态 + useWebSocketStore.getState().clearConnectionState(); login(res.token, member, deviceTotal); const { self, token } = kefuData; login2(token.access_token); diff --git a/Cunkebao/src/pages/pc/ckbox/components/ChatWindow/index.tsx b/Cunkebao/src/pages/pc/ckbox/components/ChatWindow/index.tsx index 72c88cb7..edff2cd2 100644 --- a/Cunkebao/src/pages/pc/ckbox/components/ChatWindow/index.tsx +++ b/Cunkebao/src/pages/pc/ckbox/components/ChatWindow/index.tsx @@ -84,7 +84,6 @@ const ChatWindow: React.FC = ({ // 更新上一次的消息状态 prevMessagesRef.current = currentMessages; - console.log("视频状态变化:", hasVideoStateChange, currentMessages); }, [currentMessages]); const scrollToBottom = () => { diff --git a/Cunkebao/src/store/module/weChat/weChat.ts b/Cunkebao/src/store/module/weChat/weChat.ts index 30d02e14..fd547121 100644 --- a/Cunkebao/src/store/module/weChat/weChat.ts +++ b/Cunkebao/src/store/module/weChat/weChat.ts @@ -146,7 +146,7 @@ export const useWeChatStore = create()( { name: "wechat-storage", partialize: state => ({ - currentContract: state.currentContract, + // currentContract 不做持久化,登录和页面刷新时直接清空 }), }, ),