优化banner逻辑

This commit is contained in:
李瑞
2026-02-01 23:37:31 +08:00
parent 8abf6e6f2b
commit 4c75368fe8
3 changed files with 50 additions and 50 deletions

View File

@@ -13,6 +13,7 @@ import MessagePageContent from "./components/MessagePageContent";
import MyselfPageContent from "./components/MyselfPageContent";
import "./index.scss";
import FamilyContext from "@/context";
import { useDictionaryStore } from "@/store/dictionaryStore";
type TabType = "list" | "message" | "personal";
@@ -66,6 +67,12 @@ const MainPage: React.FC = () => {
try {
await fetchUserInfo();
await checkNicknameChangeStatus();
// 启动时预取 Banner 字典(与业务无强依赖,失败不影响主流程)
try {
await useDictionaryStore.getState().fetchBannerDictionary();
} catch (e) {
console.error("预取 Banner 字典失败:", e);
}
} catch (error) {
console.error("获取用户信息失败:", error);
}