fix(api): 移除评论导出接口的站点筛选功能
移除评论导出接口的站点筛选功能,现在导出所有站点的评论数据。同时更新相关文档,移除站点隔离相关的API说明,并修复文档组件的内存泄漏问题。导入接口现在支持自动识别和转换第三方评论系统数据格式,并修复站点ID字段的导入问题。 - 移除 `/admin/comments/export` 接口的 `siteId` 查询参数 - 更新数据导入文档,说明第三方评论系统自动转换功能 - 修复文档组件页面切换时的配置更新和内存泄漏 - 修复评论和统计数据的导入逻辑,确保站点ID字段正确保存 - 更新数据库表结构,为统计相关表添加站点ID字段和联合唯一约束
This commit is contained in:
@@ -263,13 +263,8 @@ export function blockEmail(email: string): Promise<{ message: string }> {
|
||||
return post<{ message: string }>('/admin/comments/block-email', { email });
|
||||
}
|
||||
|
||||
export function exportComments(siteId?: string): Promise<any[]> {
|
||||
const searchParams = new URLSearchParams();
|
||||
if (siteId && siteId !== 'default') {
|
||||
searchParams.set('siteId', siteId);
|
||||
}
|
||||
const query = searchParams.toString();
|
||||
return get<any[]>(query ? `/admin/comments/export?${query}` : '/admin/comments/export');
|
||||
export function exportComments(): Promise<any[]> {
|
||||
return get<any[]>('/admin/comments/export');
|
||||
}
|
||||
|
||||
export function importComments(data: any[]): Promise<{ message: string }> {
|
||||
|
||||
@@ -180,7 +180,7 @@ async function executeExport(apiFunc: () => Promise<any>, fileNamePrefix: string
|
||||
}
|
||||
|
||||
// 导出处理
|
||||
const handleExportComments = () => executeExport(() => exportComments(currentSiteId.value), 'comments-export');
|
||||
const handleExportComments = () => executeExport(exportComments, 'comments-export');
|
||||
const handleExportConfig = () => executeExport(exportConfig, 'cwd-config');
|
||||
const handleExportStats = () => executeExport(() => exportStats(currentSiteId.value), 'cwd-stats');
|
||||
const handleExportBackup = () => executeExport(exportBackup, 'cwd-full-backup');
|
||||
|
||||
Reference in New Issue
Block a user