feat: generate docs

This commit is contained in:
2026-01-11 12:24:46 +08:00
parent 14aa3436cf
commit cd50716dc6
12 changed files with 32 additions and 107 deletions

View File

@@ -1,15 +1,18 @@
# ADR 0002: 状态管理
## 背景
需要在前端管理用户信息、全局配置以及各页面的复杂 UI 状态。
## 决策
- **全局状态**: 使用 Zustand。
- **理由**:
- 相比 Redux 模板代码极少。
- 相比 Context API 性能更好且不引起全量重绘。
- 符合 React 19 的 Concurrent 模式。
- **理由**:
- 相比 Redux 模板代码极少。
- 相比 Context API 性能更好且不引起全量重绘。
- 符合 React 19 的 Concurrent 模式。
- **持久化**: 对关键状态(如 Token使用 Zustand 的 persist 中间件。
## 后果
状态管理逻辑高度内聚在 `apps/web/src/stores` 中。