Files
EchoChat/docs/api/admin/auth.md
bujinyuan 7dcd89c7fc docs: API 文档按端+模块二级目录重组
- 前台用户端 API 迁移到 frontend/ 目录(auth/contact/im/meeting/notify)
- 后台管理端 admin.md 拆分为 admin/ 目录下 4 个文档(auth/user/meeting/system)
- WebSocket 协议保留在根目录(跨端通用)
- 更新 README 导航为两级结构,补充目录结构说明
- 更新所有文档间的交叉引用路径

Made-with: Cursor
2026-02-28 09:52:52 +08:00

33 lines
964 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 管理端 — 认证 API
> 通用规范(认证方式、响应格式、错误码)见 [README.md](../README.md)
---
## 接口列表
| 方法 | 路径 | 权限 | 说明 |
|------|------|------|------|
| POST | /api/v1/admin/auth/login | 公开 | 管理员登录 |
---
## 1. 管理员登录
`POST /api/v1/admin/auth/login`
**权限:** 公开
**请求参数:** 与前台用户登录接口格式一致
| 字段 | 类型 | 必填 | 说明 |
|------|------|------|------|
| account | string | 是 | 用户名或邮箱 |
| password | string | 是 | 登录密码 |
**说明:** 登录后会额外验证用户是否拥有 admin 或 super_admin 角色,如果没有对应角色则返回 1003权限不足。管理员与普通用户共用 `auth_users` 表,通过角色区分权限。
**成功响应:** 与前台登录接口返回格式一致,包含 token、refresh_token、用户信息等。
**可能的错误码:** 1001, 1003, 2003, 2004