diff --git a/src/App.jsx b/src/App.jsx index f045f93..ada2253 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,6 +1,10 @@ import { BrowserRouter, Route, Routes } from "react-router-dom"; +import { useEffect } from "react"; +import { useDispatch } from "react-redux"; import Layout from "./components/Layout"; import routes from "./routes"; +import { mockData } from "./data/mockData"; +import { setStudentInfo } from "./store/slices/studentSlice"; // 样式文件导入 import "./global.css"; @@ -26,7 +30,16 @@ const getAllRoutes = (routes) => { }; function App() { + const dispatch = useDispatch(); const allRoutes = getAllRoutes(routes); + + useEffect(() => { + // 初始化学生信息 + if (mockData.profileOverview?.studentInfo) { + dispatch(setStudentInfo(mockData.profileOverview.studentInfo)); + } + }, [dispatch]); + return ( diff --git a/src/pages/CalendarPage/index.css b/src/pages/CalendarPage/index.css index a3282af..253594a 100644 --- a/src/pages/CalendarPage/index.css +++ b/src/pages/CalendarPage/index.css @@ -1,3 +1,12 @@ +/* CSS变量定义 */ +:root { + --primary-color: #3b82f6; + --border-color: #e5e6eb; + --text-color: #1d2129; + --text-muted: #86909c; + --bg-hover: #f2f3f5; +} + /* 日历页面样式 */ .calendar-page { width: 100%; @@ -174,7 +183,7 @@ } .day-cell.today .day-number { - background: var(--primary-color); + background: #3b82f6; color: white; width: 24px; height: 24px;