跳转至

认证 API

基础路径: /auth

注册

POST /auth/register
Content-Type: application/json

{
  "email": "user@example.com",
  "password": "password123",
  "name": "Alice"
}

响应

{ "access_token": "eyJ..." }

登录

POST /auth/login
Content-Type: application/json

{
  "email": "user@example.com",
  "password": "password123"
}

刷新令牌

POST /auth/refresh
Authorization: Bearer <token>

获取当前用户

GET /auth/me
Authorization: Bearer <token>

响应

{
  "id": "1",
  "email": "user@example.com",
  "name": "Alice"
}