mirror of
https://github.com/zuiidea/antd-admin
synced 2026-10-24 00:53:52 +00:00
Document API_PREFIX, folder structure, templates, and E2E script usage in en/zh. Co-authored-by: Cursor <cursoragent@cursor.com>
33 lines
1.4 KiB
Plaintext
33 lines
1.4 KiB
Plaintext
---
|
||
title: 目录结构
|
||
description: 模板应用 src 目录职责说明
|
||
---
|
||
|
||
# 目录结构
|
||
|
||
两个模板的目录高度一致,差异主要在 **i18n(`locales/`)** 与 **部分脚本**。以下以 `apps/with-lingui` 为例(`apps/basic` 无 `locales/`,且无 Lingui 相关脚本)。
|
||
|
||
```
|
||
src/
|
||
├── api/
|
||
│ ├── request.ts # 传输层(axios、defineApi、刷新 token)
|
||
│ ├── schemas.ts # 兼容 barrel
|
||
│ ├── shared/ # API_PREFIX、分页/params/menu 等
|
||
│ ├── auth/ # 认证 API 与 paths
|
||
│ └── users/ # 用户 CRUD 与 query keys
|
||
├── components/ # 通用 UI(表格壳、表单弹窗、布局等)
|
||
├── hooks/ # 主题、权限、CRUD 等组合逻辑
|
||
├── locales/ # Lingui:仅 with-lingui(en/zh .po)
|
||
├── mocks/ # MSW handlers(路径与 api 模块常量一致)
|
||
├── routes/ # TanStack Router 文件路由
|
||
├── stores/ # Zustand(auth、settings 等持久化)
|
||
└── utils/ # 常量、菜单等(不含 HTTP 客户端)
|
||
```
|
||
|
||
API 约定详见 [开发代理与 Mock](/backend/proxying-api-requests)。
|
||
|
||
更完整的树状说明见:
|
||
|
||
- [apps/basic/README.md](https://github.com/zuiidea/antd-admin/blob/master/apps/basic/README.md)
|
||
- [apps/with-lingui/README.md](https://github.com/zuiidea/antd-admin/blob/master/apps/with-lingui/README.md)
|