feat(backend): 添加 Swagger 文档并优化认证接口

- 在 .env 文件中添加 ENABLE_SWAGGER 环境变量
- 在 app.js 中集成 Swagger UI
- 重构 auth 路由,添加请求参数验证
- 更新 API 文档,遵循 OpenAPI 3.0 规范
-优化认证接口的错误处理和响应格式
This commit is contained in:
2025-08-30 15:29:51 +08:00
parent 7f9bfbb381
commit 0cad74b06f
28 changed files with 2123 additions and 691 deletions

View File

@@ -37,6 +37,8 @@
"multer": "^1.4.5-lts.1",
"mysql2": "^3.14.3",
"redis": "^5.8.2",
"swagger-jsdoc": "^6.2.8",
"swagger-ui-express": "^5.0.1",
"winston": "^3.11.0",
"xss-clean": "^0.1.4"
},
@@ -49,4 +51,4 @@
"engines": {
"node": ">=16.0.0"
}
}
}