人生轨迹功能完善

This commit is contained in:
2025-12-23 22:10:25 +08:00
parent 97abbefaa3
commit 56cacb7163
12 changed files with 310 additions and 38 deletions
+8 -6
View File
@@ -2,7 +2,6 @@ import { useState, useEffect } from 'react';
import { UserCog, PenTool, Sparkles, BookOpen, Loader2 } from 'lucide-react';
import { GlassCard, GlassButton, GlassInput, GlassSelect } from '../components/ui';
import useStore from '../store/useStore';
import { generateEpicScript } from '../services/ai';
import { scriptStyles, scriptLengths } from '../utils/constants';
/**
@@ -48,12 +47,15 @@ const ScriptView = ({ onOpenProfile }) => {
setIsLoading(true);
try {
const content = await generateEpicScript(
{ theme, style, length, character: registrationData },
lifeEvents
);
// 直接调用后端创建接口,由后端调用AI生成
await addScript({
theme,
style,
length,
character: registrationData,
events: lifeEvents
});
addScript({ theme, style, length, content });
setTheme('');
} catch (error) {
console.error('Failed to generate script:', error);