feat: 结局AI改写支持pathHistory回放和完成通知

This commit is contained in:
wangwuww111
2026-03-10 14:19:13 +08:00
parent aa23db8a89
commit 2b941cc4e0
5 changed files with 119 additions and 29 deletions

View File

@@ -164,12 +164,15 @@ export default class StoryManager {
// 先标记之前的未读草稿为已读
await this.markAllDraftsRead(userId);
console.log('[rewriteEndingAsync] pathHistory:', JSON.stringify(this.pathHistory));
const result = await post(`/drafts/ending`, {
userId: userId,
storyId: storyId,
endingName: ending?.name || '未知结局',
endingContent: ending?.content || '',
prompt: prompt
prompt: prompt,
pathHistory: this.pathHistory || [] // 传递游玩路径
}, { timeout: 30000 });
if (result && result.draftId) {
@@ -195,7 +198,8 @@ export default class StoryManager {
storyId: storyId,
endingName: ending?.name || '未知结局',
endingContent: ending?.content || '',
prompt: prompt
prompt: prompt,
pathHistory: this.pathHistory || [] // 传递游玩路径
}, { timeout: 30000 });
if (result && result.draftId) {