Files
soul-yongping/开发文档/4、前端/ui/09-管理后台说明.md
2026-02-09 15:09:29 +08:00

159 lines
4.7 KiB
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.

# 管理后台说明
## 后台入口
路径:`/admin`
## 功能模块
### 1. 数据概览 (`/admin`)
显示核心数据指标:
- 总用户数
- 总收入
- 订单数
- 转化率
- 最近订单列表
- 新注册用户列表
### 2. 内容管理 (`/admin/content`)
功能:
- 查看书籍章节列表
- 导入/导出书籍内容
- 编辑章节内容
- 管理章节价格和状态
### 3. 用户管理 (`/admin/users`)
功能:
- 查看用户列表
- 搜索用户
- 查看用户详情
- 查看购买记录
- 管理用户权限
### 4. 分销管理 (`/admin/distribution`)
功能:
- 查看分销商列表
- 查看分销收益统计
- 管理佣金比例
- 查看绑定关系
### 5. 提现管理 (`/admin/withdrawals`)
功能:
- 查看提现申请列表
- 审核提现申请
- 处理打款
- 查看提现历史
### 6. 系统设置 (`/admin/settings`)
功能:
- 支付配置(微信支付参数)
- 分销比例设置
- 作者信息编辑
- 站点配置
## 后台布局
```
┌─────────────────────────────────────────────────────┐
│ 一场SOUL的创业实验 · 管理后台 │
├──────────┬──────────────────────────────────────────┤
│ │ │
│ 📊 概览 │ 主内容区域 │
│ │ │
│ 📝 内容 │ │
│ │ │
│ 👥 用户 │ │
│ │ │
│ 🎁 分销 │ │
│ │ │
│ 💰 提现 │ │
│ │ │
│ ⚙️ 设置 │ │
│ │ │
├──────────┴──────────────────────────────────────────┤
│ 退出登录 │
└─────────────────────────────────────────────────────┘
```
## 权限控制
### 管理员判断
```typescript
// 用户对象中的 isAdmin 字段
user.isAdmin === true
```
### 访问限制
```typescript
// 在页面中检查
if (!user?.isAdmin) {
router.push('/') // 重定向到首页
}
```
## 数据展示
### 概览卡片
```
┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ 总用户数 │ │ 总收入 │ │ 订单数 │ │ 转化率 │
│ │ │ │ │ │ │ │
│ 156 │ │ ¥1,234 │ │ 89 │ │ 57.1% │
└─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘
```
### 最近订单
```
┌───────────────────────────────────────────────────┐
│ 最近订单 │
├───────────────────────────────────────────────────┤
│ 整本购买 2026-01-18 14:30 +¥9.9 微信 │
│ 单节购买 2026-01-18 13:15 +¥1.0 微信 │
│ 整本购买 2026-01-18 11:20 +¥9.9 微信 │
└───────────────────────────────────────────────────┘
```
## 后台API
### 获取统计数据
```
GET /api/admin/stats
```
### 获取用户列表
```
GET /api/admin/users?page=1&limit=20
```
### 获取订单列表
```
GET /api/admin/orders?page=1&limit=20
```
### 处理提现
```
POST /api/admin/withdrawals/process
{
"withdrawalId": "xxx",
"approved": true
}
```
### 更新设置
```
PUT /api/admin/settings
{
"distributorShare": 90,
"authorInfo": {...}
}
```
---
*文档版本v2.0 | 更新日期2026-01-18*