注册支持用户名/手机号/邮箱 + 镜像站部署脚本 + 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
This commit is contained in:
yuzhiran-dev
2026-06-01 23:14:42 +08:00
parent 6f3fe50ee0
commit 538de50bb1
329 changed files with 8777 additions and 868 deletions
Regular → Executable
+5 -1
View File
@@ -4,7 +4,7 @@
"description": "宇之然 AI - 后端 API 服务",
"main": "dist/main.js",
"scripts": {
"build": "nest build",
"build": "nest build --tsc",
"start": "nest start",
"dev": "nest start --watch",
"start:prod": "node dist/main",
@@ -38,6 +38,7 @@
"@nestjs/serve-static": "^5.0.5",
"@nestjs/swagger": "^11.4.2",
"@prisma/client": "^5.22.0",
"alipay-sdk": "^4.14.0",
"bcryptjs": "^3.0.3",
"class-transformer": "^0.5.1",
"class-validator": "^0.15.1",
@@ -62,6 +63,9 @@
"@types/node": "^20.19.40",
"@types/passport-jwt": "^4.0.1",
"@types/supertest": "^7.2.0",
"@typescript-eslint/eslint-plugin": "^8.60.0",
"@typescript-eslint/parser": "^8.60.0",
"eslint": "^8.57.1",
"jest": "^30.4.0",
"supertest": "^7.2.2",
"ts-jest": "^29.4.9",