@qlover/create-app 0.3.3 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/package.json +2 -2
  3. package/templates/react-app/README.md +311 -120
  4. package/templates/react-app/config/Identifier.I18n.ts +170 -0
  5. package/templates/react-app/config/common.ts +13 -0
  6. package/templates/react-app/package.json +6 -2
  7. package/templates/react-app/public/locales/en/common.json +25 -1
  8. package/templates/react-app/public/locales/zh/common.json +25 -1
  9. package/templates/react-app/src/App.tsx +5 -4
  10. package/templates/react-app/src/base/apis/AiApi.ts +4 -4
  11. package/templates/react-app/src/base/apis/feApi/FeApiAdapter.ts +2 -2
  12. package/templates/react-app/src/base/apis/userApi/UserApiAdapter.ts +2 -2
  13. package/templates/react-app/src/base/cases/AppConfig.ts +103 -0
  14. package/templates/react-app/src/base/cases/{appError/AppError.ts → AppError.ts} +0 -3
  15. package/templates/react-app/src/base/cases/DialogHandler.ts +86 -0
  16. package/templates/react-app/src/base/cases/RouterLoader.ts +166 -0
  17. package/templates/react-app/src/base/port/InteractionHubInterface.ts +94 -0
  18. package/templates/react-app/src/base/services/I18nService.ts +19 -0
  19. package/templates/react-app/src/base/types/deprecated-antd.d.ts +60 -0
  20. package/templates/react-app/src/core/IOC.ts +6 -1
  21. package/templates/react-app/src/core/bootstrap.ts +21 -31
  22. package/templates/react-app/src/core/globals.ts +8 -1
  23. package/templates/react-app/src/core/registers/RegisterGlobals.ts +11 -7
  24. package/templates/react-app/src/core/registers/index.ts +1 -2
  25. package/templates/react-app/src/pages/base/About.tsx +114 -1
  26. package/templates/react-app/src/pages/base/Executor.tsx +10 -15
  27. package/templates/react-app/src/styles/css/antd-themes/_default.css +239 -0
  28. package/templates/react-app/src/styles/css/antd-themes/dark.css +176 -0
  29. package/templates/react-app/src/styles/css/antd-themes/index.css +3 -0
  30. package/templates/react-app/src/styles/css/antd-themes/no-context.css +34 -0
  31. package/templates/react-app/src/styles/css/antd-themes/pink.css +199 -0
  32. package/templates/react-app/src/styles/css/index.css +3 -0
  33. package/templates/react-app/src/styles/css/themes/_default.css +10 -181
  34. package/templates/react-app/src/styles/css/themes/dark.css +10 -135
  35. package/templates/react-app/src/styles/css/themes/pink.css +10 -141
  36. package/templates/react-app/src/uikit/components/RouterRenderComponent.tsx +1 -1
  37. package/templates/react-app/src/uikit/controllers/RouterController.ts +1 -1
  38. package/templates/react-app/src/uikit/controllers/UserController.ts +1 -1
  39. package/templates/react-app/tsconfig.json +3 -2
  40. package/templates/react-app/tsconfig.node.json +2 -1
  41. package/templates/react-app/vite.config.ts +70 -2
  42. package/templates/react-app/src/base/cases/router-loader/index.ts +0 -90
  43. package/templates/react-app/src/core/AppConfig.ts +0 -36
package/CHANGELOG.md CHANGED
@@ -1,5 +1,68 @@
1
1
  # @qlover/create-app
2
2
 
3
+ ## 0.3.5
4
+
5
+ ### Patch Changes
6
+
7
+ #### ✨ Features
8
+
9
+ - enhance Vite configuration and add new dependencies for improved build performance ([e14ee42](https://github.com/qlover/fe-base/commit/e14ee428d46fc48decb99762103c25d6e6c8535e)) ([#418](https://github.com/qlover/fe-base/pull/418))
10
+
11
+ - Added `terser` for advanced minification options, including console log removal and improved compression.
12
+ - Introduced `vite-plugin-imp` to optimize Ant Design imports, reducing bundle size and improving load times.
13
+ - Updated Vite configuration to define manual chunks for better code splitting and chunk management.
14
+
15
+
16
+ Co-authored-by: QRJ <renjie.qin@brain.im>
17
+
18
+ ## 0.3.4
19
+
20
+ ### Patch Changes
21
+
22
+ #### ✨ Features
23
+
24
+ - enhance React app with Ant Design integration and theming improvements ([374eaa3](https://github.com/qlover/fe-base/commit/374eaa36ab85b71543668721888823c41793aa23)) ([#414](https://github.com/qlover/fe-base/pull/414))
25
+
26
+ - Added Vite as a dependency for improved build performance.
27
+ - Introduced new Ant Design components and updated existing ones for a consistent UI experience.
28
+ - Enhanced theming capabilities with new CSS variables and custom themes (default, dark, pink).
29
+ - Updated localization keys for the About page and added new messages for better user feedback.
30
+ - Refactored DialogHandler to manage Ant Design's static APIs globally.
31
+ - Improved overall code structure and organization for better maintainability.
32
+
33
+ Co-authored-by: QRJ <renjie.qin@brain.im>
34
+
35
+ - enhance React app with improved configuration management and new components ([67f88cb](https://github.com/qlover/fe-base/commit/67f88cbc7cc0ebab51cbd33be66f98117fc2cf21)) ([#414](https://github.com/qlover/fe-base/pull/414))
36
+
37
+ - Introduced centralized AppConfig class for managing application settings and environment variables.
38
+ - Added DialogHandler for handling notifications and confirmations using Ant Design components.
39
+ - Refactored RouterLoader to support dynamic route configurations and lazy loading of components.
40
+ - Updated various API adapters to utilize the new AppConfig structure for better maintainability.
41
+ - Removed outdated DialogHandler implementation and reorganized related files for improved clarity.
42
+
43
+ Co-authored-by: QRJ <renjie.qin@brain.im>
44
+
45
+ - integrate @brain-toolkit/antd-theme-override for improved Ant D… ([4ebb081](https://github.com/qlover/fe-base/commit/4ebb081d89397424c459dd7f885817152098e322)) ([#414](https://github.com/qlover/fe-base/pull/414))
46
+
47
+ - feat: integrate @brain-toolkit/antd-theme-override for improved Ant Design support
48
+
49
+ * Added @brain-toolkit/antd-theme-override as a dependency to enhance theming capabilities.
50
+ * Updated imports to utilize the new theming library, replacing the deprecated antd-overried references.
51
+ * Removed outdated files related to the previous Ant Design integration to streamline the codebase.
52
+ * Refactored components to leverage the new theme provider and static API interface for notifications and modals.
53
+
54
+ Co-authored-by: QRJ <renjie.qin@brain.im>
55
+
56
+ - feat(I18nService): add translation method for improved localization support
57
+
58
+ * Implemented a new `t` method in the I18nService class to facilitate key-based translations.
59
+ * The method accepts a translation key and optional parameters, returning the translated value or the key if no translation is found.
60
+ * Enhanced localization handling to improve user experience across the application.
61
+
62
+ ***
63
+
64
+ Co-authored-by: QRJ <renjie.qin@brain.im>
65
+
3
66
  ## 0.3.3
4
67
 
5
68
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qlover/create-app",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "main": "./dist/index.cjs",
@@ -51,8 +51,8 @@
51
51
  "inquirer": "^12.3.2",
52
52
  "ora": "^8.1.1",
53
53
  "lodash": "^4.17.21",
54
- "@qlover/logger": "0.1.1",
55
54
  "@qlover/scripts-context": "0.2.1",
55
+ "@qlover/logger": "0.1.1",
56
56
  "@qlover/fe-corekit": "1.4.0"
57
57
  },
58
58
  "scripts": {
@@ -2,185 +2,376 @@
2
2
 
3
3
  一个现代化的 React 前端项目模板,集成了多项实用功能和最佳实践。
4
4
 
5
- ## 特性亮点
5
+ ## 🌟 特性亮点
6
6
 
7
7
  - 🚀 基于 Vite 的快速开发体验
8
8
  - 🎨 集成 Tailwind CSS 的主题系统
9
- - 🌍 完善的国际化支持
10
- - 🔄 IOC 容器的依赖注入
9
+ - 🌍 完善的国际化支持(中英文)
10
+ - 🔄 基于 TypeScript 的 IOC 容器
11
11
  - 📡 统一的 API 请求处理
12
12
  - 🎮 控制器模式的状态管理
13
+ - 📦 使用 pnpm 进行包管理
14
+ - 🧪 内置测试支持
13
15
 
14
- ## 环境要求
16
+ ## 🔧 环境要求
15
17
 
16
18
  - Node.js >= 16
17
19
  - pnpm >= 8.0
18
20
 
19
- ## 配置说明
21
+ ## 📁 项目结构
22
+
23
+ ```tree
24
+ ├── config/ # 配置文件目录
25
+ │ ├── app.router.json # 路由页面配置
26
+ │ ├── common.ts # 应用通用配置
27
+ │ ├── app.router.json # 路由配置
28
+ │ ├── i18n.ts # 国际化配置
29
+ │ └── theme.json # 主题配置
30
+ ├── lib/ # 公共库目录
31
+ ├── public/ # 静态资源目录
32
+ ├── src/
33
+ │ ├── base/ # 基础代码
34
+ │ ├── core/ # 核心代码
35
+ │ ├── pages/ # 页面组件
36
+ │ ├── services/ # 服务层
37
+ │ └── uikit/ # UI 组件库
38
+ └── vite.config.ts # Vite 配置文件
39
+ ```
20
40
 
21
- 项目配置文件位于 `config/` 目录:
41
+ ## 🚀 快速开始
22
42
 
23
- - `app.common.ts`: 应用通用配置,包含 API 配置、默认登录信息等
24
- - `app.router.json`: 路由配置,定义应用的路由结构
25
- - `i18n.ts`: 国际化配置,支持中英文切换
26
- - `theme.json`: 主题配置,定义应用的主题系统
43
+ ### 安装依赖
27
44
 
28
- ## 项目结构
45
+ ```bash
46
+ pnpm install
47
+ ```
29
48
 
30
- ├── config/ # 配置文件目录
31
- │ ├── app.common.ts # 应用通用配置
32
- │ ├── app.router.json # 路由配置
33
- │ ├── i18n.ts # 国际化配置
34
- │ └── theme.json # 主题配置
35
- ├── lib/ # 公共库目录
36
- │ ├── fe-react-controller/ # React 控制器库
37
- │ ├── fe-react-theme/ # React 主题库
38
- │ ├── openAiApi/ # OpenAI API 封装
39
- │ ├── request-common-plugin/ # 请求公共插件
40
- │ └── tw-root10px/ # Tailwind 10px 根字体配置
41
- ├── public/ # 静态资源目录
42
- │ └── locales/ # 国际化资源文件
43
- ├── src/ # 源代码目录
44
- │ ├── base/ # 基础代码
45
- │ │ ├── apis/ # API 接口定义
46
- │ │ ├── cases/ # 业务用例
47
- │ │ ├── port/ # 接口定义
48
- │ │ └── types/ # 类型定义
49
- │ ├── core/ # 核心代码
50
- │ │ └── feIOC/ # IOC 容器实现
51
- │ │ └── globals.ts # 全局变量
52
- │ │ └── bootstrap.ts # 启动器
53
- │ ├── pages/ # 页面组件
54
- │ ├── services/ # 服务层
55
- │ └── uikit/ # UI 组件库
56
- └── vite.config.ts # Vite 配置文件
49
+ ### 开发模式
57
50
 
58
- ## 目录结构说明
51
+ ```bash
52
+ pnpm dev
53
+ ```
59
54
 
60
- 1. `config/`: 集中管理配置文件,便于统一维护和修改
61
- 2. `lib/`: 可复用的独立功能库,方便跨项目使用
62
- 3. `src/base/`: 基础代码层,定义接口和类型
63
- 4. `src/core/`: 核心功能实现,包含 IOC 容器等基础设施
64
- 5. `src/pages/`: 页面组件,按功能模块组织
65
- 6. `src/services/`: 服务层,处理业务逻辑
66
- 7. `src/uikit/`: UI 组件库,提供可复用的界面组件
55
+ ### 构建项目
67
56
 
68
- ## 核心特性
57
+ ```bash
58
+ pnpm build
59
+ ```
69
60
 
70
- ### 1. IOC 容器
61
+ ### 运行测试
71
62
 
72
- 项目使用依赖注入容器管理依赖,主要包含:
63
+ ```bash
64
+ pnpm test
65
+ ```
73
66
 
74
- - `FeIOC`: IOC 容器的核心实现
75
- - `RegisterApi`: API 服务注册
76
- - `RegisterCommon`: 通用服务注册
77
- - `RegisterControllers`: 控制器注册
67
+ ## 🔨 核心功能
78
68
 
79
- ### 2. 国际化支持
69
+ ### IOC 容器
80
70
 
81
- - 支持中文和英文
82
- - 使用 i18next 实现
83
- - 按模块划分语言文件
71
+ - 基于 TypeScript 的依赖注入系统
72
+ - 支持服务自动注册和依赖管理
73
+ - 提供完整的类型推导
84
74
 
85
- ### 3. 主题系统
75
+ ### 国际化支持
86
76
 
87
- - 支持主题切换
88
- - 基于 Tailwind CSS
89
- - 自定义 10px 根字体配置
77
+ - 基于 i18next 的完整国际化解决方案
78
+ - 支持中文(zh)和英文(en)双语切换
79
+ - 基于 TypeScript 注释的自动国际化资源生成
80
+ - URL 路径语言检测和切换
81
+ - 内置语言切换组件
90
82
 
91
- ### 4. API 请求处理
83
+ #### 国际化配置
92
84
 
93
- - 统一的请求处理机制
94
- - 支持请求拦截和响应处理
95
- - Mock 数据支持
96
- - OpenAI API 集成
85
+ 项目使用 `@brain-toolkit/ts2locales` 插件从 TypeScript 注释自动生成国际化资源:
97
86
 
98
- ### 5. 控制器模式
87
+ ```typescript
88
+ // config/Identifier.I18n.ts
89
+ export const Messages = {
90
+ /**
91
+ * @description Home page welcome message
92
+ * @localZh 欢迎来到主页
93
+ * @localEn Welcome to the home page
94
+ */
95
+ HOME_WELCOME: 'home.welcome',
99
96
 
100
- 采用控制器模式管理业务逻辑:
97
+ /**
98
+ * @description Get started button text
99
+ * @localZh 开始使用
100
+ * @localEn Get Started
101
+ */
102
+ HOME_GET_STARTED: 'home.get_started'
103
+ };
104
+ ```
101
105
 
102
- - `JSONStorageController`: JSON 存储控制
103
- - `RequestController`: 请求控制
104
- - `RouterController`: 路由控制
105
- - `UserController`: 用户控制
106
- - `ThemeController`: 主题控制
106
+ Vite 插件配置:
107
+
108
+ ```typescript
109
+ // vite.config.ts
110
+ import ts2Locales from '@brain-toolkit/ts2locales/vite';
111
+ import i18nConfig from './config/i18n';
112
+
113
+ export default defineConfig({
114
+ plugins: [
115
+ ts2Locales({
116
+ locales: i18nConfig.supportedLngs,
117
+ options: [
118
+ {
119
+ source: './config/Identifier.Error.ts',
120
+ target: './public/locales/{{lng}}/common.json'
121
+ },
122
+ {
123
+ source: './config/Identifier.I18n.ts',
124
+ target: './public/locales/{{lng}}/common.json'
125
+ }
126
+ ]
127
+ })
128
+ ]
129
+ });
130
+ ```
107
131
 
108
- ## 技术栈
132
+ #### 国际化服务
109
133
 
110
- - React
111
- - TypeScript
112
- - Vite
113
- - Tailwind CSS
114
- - i18next
134
+ 项目提供了 `I18nService` 用于管理国际化状态和语言切换:
115
135
 
116
- ## 开发
136
+ ```typescript
137
+ import { I18nService } from '@/base/services/I18nService';
117
138
 
118
- 项目使用 pnpm 管理依赖,请先安装 pnpm
139
+ // 获取当前语言
140
+ const currentLang = I18nService.getCurrentLanguage();
119
141
 
120
- ```bash
121
- npm install -g pnpm
142
+ // 切换语言
143
+ await i18nService.changeLanguage('zh');
122
144
  ```
123
145
 
124
- ## 开发指南
146
+ #### 在组件中使用
125
147
 
126
- ### API 开发
148
+ ```typescript
149
+ import { useBaseRoutePage } from '@/uikit/contexts/BaseRouteContext';
150
+ import * as i18nKeys from '@config/Identifier.I18n';
127
151
 
128
- 项目使用统一的 API 请求处理机制:
152
+ function MyComponent() {
153
+ const { t } = useBaseRoutePage();
129
154
 
130
- - 支持请求拦截和响应处理
131
- - 内置 Mock 数据支持
132
- - 集成 OpenAI API
155
+ return (
156
+ <div>
157
+ <h1>{t(i18nKeys.HOME_WELCOME)}</h1>
158
+ <button>{t(i18nKeys.HOME_GET_STARTED)}</button>
159
+ </div>
160
+ );
161
+ }
162
+ ```
133
163
 
134
- ### 控制器开发
164
+ #### 语言切换组件
135
165
 
136
- 项目采用控制器模式管理业务逻辑:
166
+ 项目提供了开箱即用的语言切换组件:
137
167
 
138
- - `JSONStorageController`: 处理 JSON 数据存储
139
- - `RequestController`: 处理 API 请求
140
- - `UserController`: 处理用户认证
141
- - `ThemeController`: 处理主题切换
168
+ ```typescript
169
+ import LanguageSwitcher from '@/uikit/components/LanguageSwitcher';
142
170
 
143
- ### 国际化开发
171
+ function Header() {
172
+ return (
173
+ <header>
174
+ <LanguageSwitcher />
175
+ </header>
176
+ );
177
+ }
178
+ ```
144
179
 
145
- 语言文件位于 `public/locales/` 目录:
180
+ #### 最佳实践
146
181
 
147
- - `zh/`: 中文语言包
148
- - `en/`: 英文语言包
182
+ 1. 国际化标识符管理:
149
183
 
150
- ### 安装依赖
184
+ - 在 `config/Identifier.I18n.ts` 中集中管理UI文本
185
+ - 在 `config/Identifier.Error.ts` 中集中管理错误信息
186
+ - 使用有意义的 key 命名(如:'page.home.title')
151
187
 
152
- ```bash
153
- pnpm install
154
- ```
188
+ 2. TypeScript 注释规范:
155
189
 
156
- ### 开发模式
190
+ - 使用 `@description` 描述文本用途
191
+ - 使用 `@localZh` 定义中文文本
192
+ - 使用 `@localEn` 定义英文文本
157
193
 
158
- ```bash
159
- pnpm run dev
160
- ```
194
+ 3. 路由配置:
161
195
 
162
- ### 构建
196
+ - 使用 `LocaleLink` 组件进行页面跳转
197
+ - URL 格式:`/{lang}/path`(如:'/zh/about')
163
198
 
164
- ```bash
165
- pnpm run build
199
+ 4. 组件开发:
200
+ - 使用 `useBaseRoutePage` hook 获取翻译函数
201
+ - 从 `@config/Identifier.I18n` 引入国际化 key
202
+ - 避免硬编码文本,始终使用国际化 key
203
+
204
+ ### 主题系统
205
+
206
+ - 基于 Tailwind CSS 的主题配置
207
+ - 支持暗色/亮色模式
208
+ - 自定义设计令牌系统
209
+
210
+ ### API 集成
211
+
212
+ 项目提供了强大的 API 请求处理机制,基于插件化架构设计:
213
+
214
+ #### 请求控制器
215
+
216
+ 使用 `RequestController` 统一管理 API 请求:
217
+
218
+ ```typescript
219
+ @injectable()
220
+ export class RequestController extends SliceStore<RequestControllerState> {
221
+ constructor(
222
+ @inject(FeApi) private readonly feApi: FeApi,
223
+ @inject(UserApi) private readonly userApi: UserApi
224
+ ) {
225
+ super(createDefaultState);
226
+ }
227
+
228
+ // API 调用示例
229
+ async onRandomUser() {
230
+ if (this.state.randomUserState.loading) return;
231
+
232
+ this.setState({
233
+ randomUserState: { loading: true, result: null, error: null }
234
+ });
235
+
236
+ try {
237
+ const result = await this.userApi.getRandomUser();
238
+ this.setState({
239
+ randomUserState: { loading: false, result, error: null }
240
+ });
241
+ } catch (error) {
242
+ this.setState({
243
+ randomUserState: { loading: false, result: null, error }
244
+ });
245
+ }
246
+ }
247
+ }
166
248
  ```
167
249
 
168
- ### 测试
250
+ #### 请求插件系统
251
+
252
+ 项目内置多个实用的请求插件:
253
+
254
+ 1. `FetchURLPlugin`: URL 处理和构建
255
+ 2. `RequestCommonPlugin`: 通用请求配置
256
+ 3. `ApiMockPlugin`: Mock 数据支持
257
+ 4. `FetchAbortPlugin`: 请求中断控制
258
+ 5. `RequestLogger`: 请求日志记录
259
+ 6. `ApiCatchPlugin`: 统一错误处理
260
+
261
+ 使用示例:
262
+
263
+ ```typescript
264
+ // 配置请求适配器
265
+ const adapter = new RequestAdapter({
266
+ plugins: [
267
+ new FetchURLPlugin(),
268
+ new RequestCommonPlugin(),
269
+ new ApiMockPlugin(),
270
+ new FetchAbortPlugin(),
271
+ new RequestLogger()
272
+ ]
273
+ });
274
+
275
+ // 发起请求
276
+ const response = await adapter.request({
277
+ url: '/api/users',
278
+ method: 'GET',
279
+ requestId: 'uniqueId', // 用于中断请求
280
+ mock: true // 启用 mock 数据
281
+ });
282
+ ```
169
283
 
170
- ```bash
171
- pnpm run test
284
+ #### 请求调度器
285
+
286
+ 使用 `RequestScheduler` 管理复杂的请求流程:
287
+
288
+ ```typescript
289
+ export class FeApi extends RequestScheduler<RequestConfig> {
290
+ async getIpInfo() {
291
+ return this.request<void, IpInfo>({
292
+ url: '/api/ip',
293
+ method: 'GET'
294
+ });
295
+ }
296
+ }
172
297
  ```
173
298
 
174
- ## 常见问题
299
+ #### Mock 数据支持
300
+
301
+ 项目支持灵活的 Mock 数据配置:
302
+
303
+ ```typescript
304
+ // 配置 Mock 数据
305
+ const mockConfig = {
306
+ '/api/users': {
307
+ GET: () => ({
308
+ code: 200,
309
+ data: {
310
+ id: 1,
311
+ name: 'John Doe'
312
+ }
313
+ })
314
+ }
315
+ };
316
+
317
+ // 在请求中使用
318
+ const response = await api.request({
319
+ url: '/api/users',
320
+ method: 'GET',
321
+ mock: true // 启用 mock
322
+ });
323
+ ```
175
324
 
176
- ### Q: 如何切换主题?
325
+ #### 最佳实践
177
326
 
178
- A: 项目支持主题切换功能,通过 ThemeController 进行控制。
327
+ 1. API 定义:
179
328
 
180
- ### Q: 如何添加新的语言支持?
329
+ - `src/base/apis` 中集中管理 API 定义
330
+ - 使用 TypeScript 接口定义请求和响应类型
331
+ - 遵循 RESTful API 设计规范
181
332
 
182
- A: 在 `public/locales/` 目录下添加新的语言文件,并在 `i18n.ts` 中配置。
333
+ 2. 错误处理:
183
334
 
184
- ## 许可证
335
+ - 使用 `ApiCatchPlugin` 统一处理错误
336
+ - 定义清晰的错误类型和错误码
337
+ - 提供友好的错误提示
338
+
339
+ 3. 请求状态管理:
340
+
341
+ - 使用 `SliceStore` 管理请求状态
342
+ - 处理加载、成功、错误等状态
343
+ - 实现请求防抖和节流
344
+
345
+ 4. Mock 数据:
346
+ - 提供合理的 Mock 数据结构
347
+ - 支持动态 Mock 数据生成
348
+ - 便于本地开发和测试
349
+
350
+ ### 控制器模式
351
+
352
+ 提供多个开箱即用的控制器:
353
+
354
+ - JSONStorageController
355
+ - RequestController
356
+ - RouterController
357
+ - UserController
358
+ - ThemeController
359
+
360
+ ## 📚 开发指南
361
+
362
+ ### API 开发规范
363
+
364
+ 1. 在 `src/base/apis` 定义接口
365
+ 2. 支持 Mock 数据配置
366
+
367
+ ### 新增页面流程
368
+
369
+ 1. 在 `src/pages` 创建页面组件
370
+ 2. 更新 `config/app.router.json`
371
+ 3. 添加对应的控制器(如需要)
372
+
373
+ ### 国际化开发
185
374
 
186
- ISC
375
+ 1. 在 `public/locales` 添加翻译文件
376
+ 2. 使用 `useTranslation` hook 进行调用
377
+ 3. 支持按需加载语言包