Files
ai-learning-platform/docs/archive/progress-2026-05-12-before-notifications.md
yuzhiran-dev 538de50bb1 注册支持用户名/手机号/邮箱 + 镜像站部署脚本 + AI 助手 Tool Calling 重构
- Prisma User 模型新增 username 字段(唯一索引)
- 注册先查重复再创建,返回友好中文提示(非 500)
- 登录支持用户名/手机号/邮箱三种方式
- 前端注册表单增加用户名输入框,预校验 2-20 位格式
- 新增 scripts/deploy.sh:一键构建并部署主站+镜像站+重启后端+重载 Nginx
- 镜像站 www.yuzhiran.com.cn Nginx 配置与主站同步
- AI 助手架构升级:用户端/管理后台均采用完整 Tool Calling 架构
- 新增 UserAiAssistantService(18 工具)+ AiAssistantController
- admin 助手新增 search + mark-all-notifications-read 工具
- 修复注册 500 错误:catch Prisma P2002 → BadRequestException
- Baidu Analytics Script 注入 root layout
2026-06-01 23:14:42 +08:00

93 lines
3.1 KiB
Markdown
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 项目进度追踪
> 每次完成任务后更新此文件。旧版归档到 `docs/archive/`。
---
## Phase 1: 基础框架搭建 ✅ 已完成
### 后端
- [x] NestJS 模块化架构搭建
- [x] JWT 认证(login/register
- [x] TypeORM + PostgreSQL 数据库连接
- [x] 全部 92 单元测试 + 13 e2e 通过
- [x] CORS 配置(`origin: true`, `maxAge: 0`
### 前端
- [x] Next.js App Router + shadcn/ui 集成
- [x] 暗黑模式(`next-themes` + Tailwind class 策略)
- [x] 导航栏激活态高亮(`usePathname()`
- [x] 错误边界组件(`not-found.tsx`, `error.tsx`, `global-error.tsx`
- [x] Favicon 配置(png + svg
- [x] 全站 `text-gray-*` → CSS 变量替换(35+ 页面)
- [x] 全站 `bg-gray-*` / `border-gray-*` → CSS 变量替换
### 页面布局统一化
- [x] 容器标准:`max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12`
- [x] 标题标准:`text-3xl font-bold text-foreground`
- [x] 副标题标准:`text-muted-foreground`
- [x] 法律/文本页:`max-w-3xl`(长文可读性)
- [x] my/* 子页容器统一(`max-w-4xl/2xl``max-w-7xl`
- [x] admin/enterprise 容器统一(`max-w-6xl``max-w-7xl`
- [x] users/[id] 容器统一(`max-w-4xl``max-w-7xl`
### 测试
- [x] search.service 测试(新增)
- [x] tools.service 测试(新增)
- [x] users.service 测试(新增、含 bug 修复验证)
---
## Phase 2: 功能补全 ✅ 已完成
### 缺失页面补充
- [x] `/community/[id]` 帖子详情页(含评论)
- [x] `/admin/courses/new` & `[id]` 课程新建/编辑
- [x] `/admin/prompts/new` & `[id]` 提示词新建/编辑
- [x] `/admin/contents/new` & `[id]` 内容新建/编辑
- [x] `/admin/tools/new` & `[id]` 工具新建/编辑
### Sandbox 沙盒
- [x] 流式 API 集成(`ReadableStream`
- [x] 模型选择器(URL query 预设)
- [x] 明暗切换
- [x] 固定头尾布局 `h-[calc(100vh-4rem)]`
### 企业版模块
- [x] 编辑组织 UI
- [x] 截止日期选择器
- [x] 管理员角色校验(`ForbiddenException`
### 静态构建修复
- [x] 所有动态路由添加 `generateStaticParams()`
- [x] 共修复 11 个动态路由目录(users, admin/courses, admin/contents, admin/prompts, admin/tools, admin/enterprise, admin/enterprise/report, circles, community, contents, courses
- [x] 使用的模式:server component wrapperpage.tsx + client componentclient.tsx 等)
- [x] 全量构建通过(54 页面静态生成)
- [x] 修复了 admin/enterprise/[id] 及 report 页面的 JSX 结构错误
---
## Phase 3: 🚧 进行中
- [ ] 通知系统 UI`notification_service` 表)
- [ ] Loading 状态统一升级(spinner → Skeleton
- [ ] 社区互动功能(点赞、评论)
- [x] 全量静态构建验证(✅ 通过)
---
## 关键指标
| 指标 | 当前值 |
|------|--------|
| 后端测试数 | 10592 单元 + 13 e2e |
| 后端测试通过率 | 100% |
| 前端页面数 | 54(全部静态生成) |
| 暗黑模式兼容 | 全站 100% |
| 静态构建状态 | ✅ 通过 |
| next build status | ✅ 54/54 页面成功 |
---
> 最后更新:2026-05-12