模版改回来

This commit is contained in:
北枳 2025-09-08 17:52:58 +08:00
parent 0a81879766
commit ae620d35fc
4 changed files with 33 additions and 22 deletions

View File

@ -1,7 +1,6 @@
import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, InternalAxiosRequestConfig, AxiosHeaders } from 'axios';
import { BASE_URL } from './constants'
import { errorHandle } from './errorHandle';
import { showInsufficientPointsNotification } from '../utils/notifications';
/**
*
@ -52,19 +51,8 @@ request.interceptors.response.use(
// 处理业务层面的错误
const businessCode = response.data?.code;
const errorMessage = response.data?.message;
// 特殊处理 401 和 4001 业务状态码
if (businessCode === 401) {
errorHandle(401, errorMessage);
return Promise.reject(new Error(errorMessage));
}
if (businessCode === 4001) {
errorHandle(4001, errorMessage);
return Promise.reject(new Error(errorMessage));
}
// 其他业务错误
errorHandle(0, errorMessage);
errorHandle(businessCode, errorMessage);
return Promise.reject(new Error(errorMessage));
}
@ -82,9 +70,7 @@ request.interceptors.response.use(
return Promise.reject(new Error('Insufficient points'));
}
// 其他错误走通用处理
handleRequestError(error);
return Promise.reject(error);
}
);

View File

@ -75,7 +75,7 @@ export const useTemplateStoryServiceHook = (): UseTemplateStoryService => {
constraints: "",
free_input_text: ""
};
template.storyRole = [];
// template.storyRole = [];
}
if (template.id === 'e7438cd8-a23d-4974-8cde-13b5671b410c') {
template.freeInputItem = {
@ -83,7 +83,10 @@ export const useTemplateStoryServiceHook = (): UseTemplateStoryService => {
constraints: "",
free_input_text: ""
};
template.storyItem = [];
template.storyItem = [{
...template.storyItem[0],
item_name: "English word"
}];
}
});

View File

@ -672,7 +672,7 @@ const RenderTemplateStoryMode = ({
</div>
)}
{/** 自由输入文字 */}
{/* *
{(selectedTemplate?.freeInputItem) && (
<div className="py-2 flex-1 flex flex-col" style={{
height: 'calc(70vh - 300px - 8rem)'
@ -700,7 +700,7 @@ const RenderTemplateStoryMode = ({
}}
/>
</div>
)}
)} */}
{/* 角色自定义部分 - 精简布局 */}
{/* <div className="p-4">
@ -821,6 +821,28 @@ const RenderTemplateStoryMode = ({
</div>
</div> */}
<div className=" absolute -bottom-8 right-0 w-full flex items-center justify-end gap-2">
{/** 自由输入文字 */}
{(selectedTemplate?.freeInputItem) && (
<div className="py-2 flex-1">
<input
type="text"
value={selectedTemplate?.freeInputItem?.free_input_text || ""}
placeholder={selectedTemplate?.freeInputItem.user_tips}
className="w-full px-3 py-2 pr-16 bg-white/0 border border-white/10 rounded-lg text-white placeholder-gray-400 focus:outline-none focus:border-blue-500 focus:ring-1 focus:ring-blue-500/30 transition-all duration-200 text-sm"
onChange={(e) => {
// 更新自由输入文字字段
const updatedTemplate = {
...selectedTemplate!,
freeInputItem: {
...selectedTemplate!.freeInputItem,
free_input_text: e.target.value
}
};
setSelectedTemplate(updatedTemplate as StoryTemplateEntity);
}}
/>
</div>
)}
<ActionButton
isCreating={isTemplateCreating || localLoading > 0}
handleCreateVideo={handleConfirm}

View File

@ -2,7 +2,7 @@
import React, { useRef, useEffect, useState, SetStateAction, useMemo } from 'react';
import { motion, AnimatePresence } from 'framer-motion';
import { Edit3, Play, Pause, Volume2, VolumeX, Maximize, Minimize, Loader2, X, Scissors, RotateCcw, MessageCircleMore, Download, ArrowDownWideNarrow } from 'lucide-react';
import { Edit3, Play, Pause, Volume2, VolumeX, Maximize, Minimize, Loader2, X, Scissors, RotateCcw, MessageCircleMore, Download, ArrowDownWideNarrow, CircleAlert } from 'lucide-react';
import { ProgressiveReveal, presets } from '@/components/ui/progressive-reveal';
import { GlassIconButton } from '@/components/ui/glass-icon-button';
import { ScriptRenderer } from '@/components/script-renderer/ScriptRenderer';
@ -605,7 +605,7 @@ export const MediaViewer = React.memo(function MediaViewer({
{currentSketch.status === 2 && (
<div className="absolute inset-0 bg-red-500/10 flex items-center justify-center">
<div className="text-[#813b9dcc] text-2xl font-bold flex items-center gap-2">
<X className="w-10 h-10" />
<CircleAlert className="w-10 h-10" />
</div>
</div>
)}