feat(admin): 新增数据备份与恢复功能
添加配置、统计数据和全量备份的导入导出接口 重构数据管理界面,提供分类导出选项 优化导入流程,支持批量操作和错误处理
This commit is contained in:
@@ -254,6 +254,30 @@ export function importComments(data: any[]): Promise<{ message: string }> {
|
||||
return post<{ message: string }>('/admin/comments/import', data);
|
||||
}
|
||||
|
||||
export function exportConfig(): Promise<any[]> {
|
||||
return get<any[]>('/admin/export/config');
|
||||
}
|
||||
|
||||
export function importConfig(data: any[]): Promise<{ message: string }> {
|
||||
return post<{ message: string }>('/admin/import/config', data);
|
||||
}
|
||||
|
||||
export function exportStats(): Promise<any> {
|
||||
return get<any>('/admin/export/stats');
|
||||
}
|
||||
|
||||
export function importStats(data: any): Promise<{ message: string }> {
|
||||
return post<{ message: string }>('/admin/import/stats', data);
|
||||
}
|
||||
|
||||
export function exportBackup(): Promise<any> {
|
||||
return get<any>('/admin/export/backup');
|
||||
}
|
||||
|
||||
export function importBackup(data: any): Promise<{ message: string }> {
|
||||
return post<{ message: string }>('/admin/import/backup', data);
|
||||
}
|
||||
|
||||
export function fetchCommentStats(domain?: string): Promise<CommentStatsResponse> {
|
||||
const searchParams = new URLSearchParams();
|
||||
if (domain) {
|
||||
|
||||
Reference in New Issue
Block a user