按要求重构架构,从扁平的 React Context + useState 升级为大厂标准模式: Clean Architecture 分层: domain/entities/ — 业务实体 (AdminUser/User/Issuer/AppVersion) domain/repositories/ — Repository 接口(契约层) infrastructure/http/ — HttpClient(替代旧 api-client.ts) infrastructure/repositories/ — Repository 实现(AuthRepository/UserRepository) 状态管理(大厂混合模式): Zustand useAuthStore — 轻量客户端状态:登录会话 + localStorage 持久化 Zustand useUIStore — UI 偏好:sidebar 折叠状态持久化 Redux uiSlice — 全局通知队列、globalLoading Redux usersSlice — 用户列表筛选/分页 client state React Query — 服务端数据 fetching/缓存(保留) 更新: providers.tsx — 加入 Redux Provider,移除旧 AuthProvider auth-context.tsx — 向下兼容层,re-export Zustand store api-client.ts — 向下兼容层,re-export httpClient AdminLayout.tsx — 使用 Zustand auth/ui store Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| nginx | ||
| public | ||
| src | ||
| .dockerignore | ||
| .env.development | ||
| .env.production | ||
| .gitignore | ||
| DEPLOY.md | ||
| Dockerfile | ||
| deploy.sh | ||
| docker-compose.yml | ||
| next.config.ts | ||
| package-lock.json | ||
| package.json | ||
| tsconfig.json | ||