update:1.切换数据库PostgreSQL

This commit is contained in:
xiamuceer
2025-11-10 21:16:55 +08:00
parent dfea51cfa4
commit 20d9319a16
31 changed files with 2526 additions and 256 deletions
@@ -67,6 +67,14 @@ export default function ChapterAnalysis({ chapterId, visible, onClose }: Chapter
}
const taskData: AnalysisTask = await response.json();
// 如果状态为 none(无任务),设置 task 为 null,让前端显示"开始分析"按钮
if (taskData.status === 'none' || !taskData.has_task) {
setTask(null);
setError(null); // 清除错误,这不是错误状态
return;
}
setTask(taskData);
if (taskData.status === 'completed') {
+1
View File
@@ -321,6 +321,7 @@ export default function Chapters() {
setAnalysisTasksMap(prev => ({
...prev,
[editingId]: {
has_task: true,
task_id: taskId,
chapter_id: editingId,
status: 'pending',
+8 -6
View File
@@ -390,14 +390,16 @@ export interface ApiError {
// 章节分析任务相关类型
export interface AnalysisTask {
task_id: string;
has_task: boolean;
task_id: string | null;
chapter_id: string;
status: 'pending' | 'running' | 'completed' | 'failed';
status: 'pending' | 'running' | 'completed' | 'failed' | 'none';
progress: number;
error_message?: string;
created_at?: string;
started_at?: string;
completed_at?: string;
error_message?: string | null;
auto_recovered?: boolean;
created_at?: string | null;
started_at?: string | null;
completed_at?: string | null;
}
// 分析结果 - 钩子