fix: 移除currentContract持久化并清理调试日志和WebSocket状态
移除weChat模块中currentContract的持久化配置,避免登录和刷新时数据残留 清理ChatWindow组件中的调试日志 在登录时清空WebSocket连接状态
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -84,7 +84,6 @@ const ChatWindow: React.FC<ChatWindowProps> = ({
|
||||
|
||||
// 更新上一次的消息状态
|
||||
prevMessagesRef.current = currentMessages;
|
||||
console.log("视频状态变化:", hasVideoStateChange, currentMessages);
|
||||
}, [currentMessages]);
|
||||
|
||||
const scrollToBottom = () => {
|
||||
|
||||
@@ -146,7 +146,7 @@ export const useWeChatStore = create<WeChatState>()(
|
||||
{
|
||||
name: "wechat-storage",
|
||||
partialize: state => ({
|
||||
currentContract: state.currentContract,
|
||||
// currentContract 不做持久化,登录和页面刷新时直接清空
|
||||
}),
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user