diff --git a/store/index.js b/store/index.js index 2e440d1..fd726f0 100644 --- a/store/index.js +++ b/store/index.js @@ -273,6 +273,9 @@ const store = new Vuex.Store({ user && typeof user.attempt === "number" ? user.attempt : 1; if (!friendId) return Promise.reject(new Error("缺少 friendId")); + // 清空消息列表,避免旧消息干扰 + commit("push_MsgList", []); + // 第一步:获取列表(复用现有 action,保证 state 同步更新) const list = await dispatch("getUserlist");