docs: 更新 Swagger 文档说明、补充 Basic Auth 保护信息
All checks were successful
Deploy API Server / build-and-deploy (push) Successful in 20s

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
WangDL 2026-05-17 00:50:59 +08:00
parent 007b56dad5
commit 277c375f82

View File

@ -49,7 +49,15 @@ npm run build && npm run start:prod
### 服务器内测环境
如果需要在非本地环境启用 Swagger配置环境变量
生产环境启用 Swagger 后Swagger UI 和 OpenAPI JSON 均受 **Basic Auth** 保护:
- **Swagger UI**: https://api.longde.cloud/api-docs
- **OpenAPI JSON**: https://api.longde.cloud/api-docs-json
Apifox 导入时在 URL 中带上认证:
`https://admin:your_password@api.longde.cloud/api-docs-json`
配置环境变量:
```env
NODE_ENV=production
@ -58,15 +66,6 @@ SWAGGER_USER=your_admin_username
SWAGGER_PASSWORD=your_secure_password
```
访问时需要输入账号密码:
- **Swagger UI**: https://your-domain.com/api-docs
- **OpenAPI JSON**: https://your-domain.com/api-docs-json
### 正式生产环境
默认关闭 Swagger确保 API 结构不会公开暴露。
如需临时开启内网访问,配置同上并设置强密码。
## 环境变量
@ -202,6 +201,7 @@ src/
- [x] 数据库持久化Prisma + MySQL
- [x] 12 个业务 Repository 从内存 Map 迁到 Prisma
- [x] 全局 JwtAuthGuard
- [x] Swagger 端点 Basic Auth 保护
- [ ] 更多 AI Workflow知识导入、费曼分析、复习卡片生成
- [ ] AI 联调 + Prompt 调优
- [ ] 添加 Redis 缓存