兼容问题

This commit is contained in:
海龙 2025-08-07 14:43:43 +08:00
parent e7406be4dd
commit f3303456fb
2 changed files with 6 additions and 1 deletions

View File

@ -639,6 +639,8 @@ export const getProjectScript = async (request: {
project_id: string;
/** 生成的剧本文本 */
generated_script: string;
/**用户想法 */
script:string
}>
>("/movie/get_generated_script_by_project_id", request);
};

View File

@ -215,7 +215,10 @@ export const useScriptService = (): UseScriptService => {
// 调用API获取项目剧本数据
const response = await getProjectScript({ project_id: projectId });
if(response.data.generated_script===''){
await generateScriptFromIdea(response.data.script,projectId)
return
}
if (!response.successful) {
throw new Error(response.message || "获取项目剧本失败");
}