返回总入口:返回接口文档首页
获取当前用户信息。
鉴权:已登录
响应:
{
"id": "...",
"username": "alice",
"display_name": "Alice",
"role": "user",
"email": "alice@example.com",
"totp_enabled": true,
"avatar_url": "/user/avatar/alice"
}获取当前用户存储占用。
鉴权:已登录
响应:
{"size": 123456, "count": 42}获取当前用户安全配置摘要。
鉴权:已登录
响应:
{
"email": "alice@example.com",
"has_email": true,
"totp_enabled": true,
"smtp_enabled": true
}更新显示名。
鉴权:已登录
请求体:
{"display_name": "Alice"}响应:
{"ok": true}修改密码,并使当前会话之外的其他会话失效。
鉴权:已登录
请求体:
{"old_password": "old", "new_password": "new"}响应:
{"ok": true}发送邮箱绑定验证码。
鉴权:已登录
请求体:
{"email": "alice@example.com"}响应:
{"ok": true}确认邮箱绑定。
鉴权:已登录
请求体:
{"email": "alice@example.com", "code": "123456"}响应:
{"ok": true}解绑邮箱。
鉴权:已登录
响应:
{"ok": true}生成 TOTP Secret 与 otpauth URI。
鉴权:已登录
响应:
{
"secret": "BASE32SECRET",
"uri": "otpauth://totp/..."
}启用 TOTP。
鉴权:已登录
请求体:
{"code": "123456"}响应:
{"ok": true}关闭 TOTP。
鉴权:已登录
响应:
{"ok": true}公开读取用户头像。服务端会从 OSS 读取并解密后返回。
鉴权:无需登录
响应:
- 成功:
image/webp - 失败:
{"error": "no_avatar"}