feat(admin): 添加域名列表获取功能用于筛选
新增获取域名列表的API端点,用于统一管理评论和访问统计中的域名筛选功能。修改了前端多个视图的域名获取逻辑,从原来的分散获取改为统一调用新接口,提高代码复用性和维护性。 docs: 添加反馈页面并更新侧边栏
This commit is contained in:
@@ -257,12 +257,12 @@ import {
|
||||
CommentItem,
|
||||
CommentListResponse,
|
||||
fetchComments,
|
||||
fetchCommentStats,
|
||||
deleteComment,
|
||||
updateCommentStatus,
|
||||
updateComment,
|
||||
blockIp,
|
||||
blockEmail,
|
||||
fetchDomainList,
|
||||
} from "../api/admin";
|
||||
|
||||
const DOMAIN_STORAGE_KEY = "cwd_admin_domain_filter";
|
||||
@@ -558,11 +558,9 @@ onMounted(() => {
|
||||
domainFilter.value = d.trim();
|
||||
}
|
||||
|
||||
fetchCommentStats()
|
||||
.then((res: CommentListResponse | any) => {
|
||||
const domains = Array.isArray(res.domains)
|
||||
? res.domains.map((item: any) => item.domain)
|
||||
: [];
|
||||
fetchDomainList()
|
||||
.then((res) => {
|
||||
const domains = Array.isArray(res.domains) ? res.domains : [];
|
||||
domainOptions.value = Array.from(new Set(domains));
|
||||
})
|
||||
.catch(() => {
|
||||
|
||||
Reference in New Issue
Block a user