认证接口
登录
http
POST /api/v1/auth/login请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| username | string | 是 | 用户名 |
| password | string | 是 | 密码 |
响应示例
json
{
"code": 0,
"message": "success",
"data": {
"token": "eyJhbGciOiJIUzI1NiIs...",
"expiresIn": 7200
}
}注册
http
POST /api/v1/auth/register请求参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| username | string | 是 | 用户名 |
| password | string | 是 | 密码 |
| string | 是 | 邮箱 |
刷新 Token
http
POST /api/v1/auth/refresh请求头
Authorization: Bearer <old_token>退出登录
http
POST /api/v1/auth/logout