feat: 🎸 更新了一部分接口请求信息

This commit is contained in:
2025-08-20 22:39:05 +08:00
parent d4b4bc82f3
commit 9895101fde
13 changed files with 116 additions and 141 deletions

View File

@@ -1,12 +1,28 @@
import { useState } from "react";
import { useState, useEffect } from "react";
import { Spin } from "@arco-design/web-react";
import { useSelector } from "react-redux";
import { useSelector, useDispatch } from "react-redux";
import { getLoginStudentInfo } from "@/services";
import { setStudentInfo } from "@/store/slices/studentSlice";
import Sidebar from "../Sidebar";
import "./index.css";
const Layout = ({ children }) => {
const loading = useSelector((state) => state.loading.value);
const dispatch = useDispatch();
const [isCollapsed, setIsCollapsed] = useState(true);
const loading = useSelector((state) => state.loading.value);
const studentInfo = useSelector((state) => state.student.studentInfo);
const queryLoginStudentInfo = async () => {
const res = await getLoginStudentInfo();
dispatch(setStudentInfo(res));
};
// 初始化项目统一获取登录用户信息
useEffect(() => {
if (!studentInfo) {
queryLoginStudentInfo();
}
}, [studentInfo]);
return (
<div className="app-layout">