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/profilePOST /api/auth/change-password 这两个接口。


关联的 Auth 接口

1. 修改个人资料(Admin 自己)

PUT /api/auth/me/profile

请求体:

参数类型必填说明
nicknamestring选填昵称(至少2字符)
avatar_urlstring选填头像 URL

响应: {"success": true}

2. 修改密码(Admin 自己)

POST /api/auth/change-password

请求体:

参数类型必填说明
oldPasswordstring必填原密码
newPasswordstring必填新密码(至少6位)

响应: {"success": true}