refactor: 前端应用骨架迁移至 zustand 并统一路由权限壳

This commit is contained in:
2026-08-05 17:10:30 +08:00
parent e21f0de427
commit d53bbd8176
33 changed files with 1055 additions and 687 deletions

View File

@@ -1,6 +1,7 @@
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
import { useNavigate, useLocation } from 'react-router-dom';
import { useNavigate, useLocation } from 'react-router';
import { Layout, Menu, Button, Avatar, Badge, Dropdown, Drawer, Grid, Tooltip } from 'antd';
import { BrandLogo } from '../components/BrandLogo';
import {
DashboardOutlined,
TeamOutlined,
@@ -262,7 +263,17 @@ const MainLayout: React.FC = () => {
borderBottom: '1px solid #e5e5e7',
}}
>
{collapsed ? '学' : '学生管理系统'}
<div
style={{
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
gap: 8,
}}
>
<BrandLogo size={collapsed ? 26 : 30} />
{!collapsed && <span></span>}
</div>
</div>
{menuContent}
</Sider>
@@ -275,7 +286,12 @@ const MainLayout: React.FC = () => {
size={240}
styles={{ body: { padding: 0 } }}
className="app-navigation-drawer"
title="学生管理系统"
title={
<span style={{ display: 'inline-flex', alignItems: 'center', gap: 8 }}>
<BrandLogo size={24} />
</span>
}
>
{menuContent}
</Drawer>