Profile 个人中心 模块 API 文档
基础信息
- Base URL:
/api/admin - 认证方式: JWT Bearer Token
数据库表
users— 用户表refresh_tokens— 刷新令牌表
说明
Admin 后台没有单独的 Profile 模块页面(Admin 的个人中心在左侧菜单"个人中心"链接,对应 /profile 路由)。但 Admin 后端没有实现独立的 profile 相关 API——Admin 用户的个人资料修改、密码修改等功能,实际上复用的是 auth.js 中的 PUT /api/auth/me/profile 和 POST /api/auth/change-password 这两个接口。
关联的 Auth 接口
1. 修改个人资料(Admin 自己)
PUT /api/auth/me/profile
请求体:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| nickname | string | 选填 | 昵称(至少2字符) |
| avatar_url | string | 选填 | 头像 URL |
响应: {"success": true}
2. 修改密码(Admin 自己)
POST /api/auth/change-password
请求体:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| oldPassword | string | 必填 | 原密码 |
| newPassword | string | 必填 | 新密码(至少6位) |
响应: {"success": true}