feat(admin): 添加域名列表获取功能用于筛选

新增获取域名列表的API端点,用于统一管理评论和访问统计中的域名筛选功能。修改了前端多个视图的域名获取逻辑,从原来的分散获取改为统一调用新接口,提高代码复用性和维护性。

docs: 添加反馈页面并更新侧边栏
This commit is contained in:
anghunk
2026-01-22 10:14:17 +08:00
parent 5164f2c490
commit 2fa0e04508
9 changed files with 182 additions and 37 deletions

View File

@@ -1161,6 +1161,53 @@ GET /admin/stats/comments
}
```
### 6.2 获取域名列表
```
GET /admin/stats/domains
```
用于管理后台获取所有已产生评论或访问记录的域名列表,用于域名筛选下拉框等场景。
- 方法:`GET`
- 路径:`/admin/stats/domains`
- 鉴权需要Bearer Token
**成功响应**
- 状态码:`200`
```json
{
"domains": [
"blog.example.com",
"example.com",
"www.example.com"
]
}
```
字段说明:
| 字段名 | 类型 | 说明 |
| ---------- | --------------- | ---------------------- |
| `domains` | Array\<string\> | 域名列表,按字母排序 |
说明:
- 域名从评论数据和访问统计数据中提取
- 域名自动去重并按字母顺序排序
**错误响应**
- 状态码:`500`
```json
{
"message": "获取域名列表失败"
}
```
## 7. 访问统计相关
### 7.1 获取访问统计概览