feat(web): add login page, auth store, API client, and route guard

- API client with axios interceptors: JWT attach + 401 auto-refresh
- Auth store (Zustand): login/logout/loadFromStorage with localStorage
- Login page: gradient background, Ant Design form, error handling
- Home page: dashboard with statistics cards
- App.tsx: PrivateRoute guard, /login route, auth state restoration
- MainLayout: dynamic user display, logout dropdown, menu navigation
- Users API service: CRUD with pagination support
This commit is contained in:
iven
2026-04-11 03:38:29 +08:00
parent a7cdf67d17
commit 4a03a639a6
9 changed files with 421 additions and 27 deletions

View File

@@ -0,0 +1,37 @@
import { Typography, Card, Row, Col, Statistic } from 'antd';
import {
UserOutlined,
TeamOutlined,
FileTextOutlined,
BellOutlined,
} from '@ant-design/icons';
export default function Home() {
return (
<div>
<Typography.Title level={4}></Typography.Title>
<Row gutter={[16, 16]}>
<Col xs={24} sm={12} md={6}>
<Card>
<Statistic title="用户总数" value={0} prefix={<UserOutlined />} />
</Card>
</Col>
<Col xs={24} sm={12} md={6}>
<Card>
<Statistic title="角色数量" value={0} prefix={<TeamOutlined />} />
</Card>
</Col>
<Col xs={24} sm={12} md={6}>
<Card>
<Statistic title="流程实例" value={0} prefix={<FileTextOutlined />} />
</Card>
</Col>
<Col xs={24} sm={12} md={6}>
<Card>
<Statistic title="未读消息" value={0} prefix={<BellOutlined />} />
</Card>
</Col>
</Row>
</div>
);
}