Files
fquiz/api
chengkai3 a332ba58ba [fix]:[FL-190][系统接口中的stacktrace信息不要直接展示到页面给用户看]
- 后端:在 exception_handlers.py 添加文档注释,明确说明 stacktrace 字段仅供开发调试使用
- 前端:在 api.ts 添加 ApiErrorResponse 类型定义和文档注释,明确 readApiError 函数只提取 detail 字段展示给用户
- stacktrace 在 debug 模式下会返回给浏览器(可在开发者工具中查看),但前端不会展示到页面上

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-18 10:19:25 +08:00
..
2026-04-24 15:50:52 +08:00

API Service

FastAPI 后端服务,包含用户认证和 RBAC 权限控制。

核心能力

  • JWT Access Token(默认 8 小时)
  • Refresh SessionHttpOnly Cookie,默认 30 天,刷新轮换)
  • RBAC(用户-角色-权限)
  • 用户管理接口(需 user.manage

本地开发

python3 -m venv .venv
source .venv/bin/activate
python -m pip install -r api/requirements.txt
python -m uvicorn api.app.main:app --reload --host 0.0.0.0 --port 8000

主要接口

  • GET /health
  • GET /api/v1/ping
  • POST /api/v1/auth/register
  • POST /api/v1/auth/login
  • POST /api/v1/auth/refresh
  • POST /api/v1/auth/logout
  • GET /api/v1/auth/me
  • GET /api/v1/users