feat(admin): 添加域名列表获取功能用于筛选
新增获取域名列表的API端点,用于统一管理评论和访问统计中的域名筛选功能。修改了前端多个视图的域名获取逻辑,从原来的分散获取改为统一调用新接口,提高代码复用性和维护性。 docs: 添加反馈页面并更新侧边栏
This commit is contained in:
@@ -107,6 +107,10 @@ export type VisitPagesResponse = {
|
||||
items: VisitPageItem[];
|
||||
};
|
||||
|
||||
export type DomainListResponse = {
|
||||
domains: string[];
|
||||
};
|
||||
|
||||
export async function loginAdmin(name: string, password: string): Promise<string> {
|
||||
const res = await post<AdminLoginResponse>('/admin/login', { name, password });
|
||||
const key = res.data.key;
|
||||
@@ -265,3 +269,7 @@ export function fetchVisitPages(domain?: string, order?: 'pv' | 'latest'): Promi
|
||||
const url = query ? `/admin/analytics/pages?${query}` : '/admin/analytics/pages';
|
||||
return get<VisitPagesResponse>(url);
|
||||
}
|
||||
|
||||
export function fetchDomainList(): Promise<DomainListResponse> {
|
||||
return get<DomainListResponse>('/admin/stats/domains');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user