forked from 77media/video-flow
模版改回来
This commit is contained in:
parent
0a81879766
commit
ae620d35fc
@ -1,7 +1,6 @@
|
|||||||
import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, InternalAxiosRequestConfig, AxiosHeaders } from 'axios';
|
import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, InternalAxiosRequestConfig, AxiosHeaders } from 'axios';
|
||||||
import { BASE_URL } from './constants'
|
import { BASE_URL } from './constants'
|
||||||
import { errorHandle } from './errorHandle';
|
import { errorHandle } from './errorHandle';
|
||||||
import { showInsufficientPointsNotification } from '../utils/notifications';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 统一的错误处理函数
|
* 统一的错误处理函数
|
||||||
@ -52,19 +51,8 @@ request.interceptors.response.use(
|
|||||||
// 处理业务层面的错误
|
// 处理业务层面的错误
|
||||||
const businessCode = response.data?.code;
|
const businessCode = response.data?.code;
|
||||||
const errorMessage = response.data?.message;
|
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));
|
return Promise.reject(new Error(errorMessage));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,8 +71,6 @@ request.interceptors.response.use(
|
|||||||
return Promise.reject(new Error('Insufficient points'));
|
return Promise.reject(new Error('Insufficient points'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 其他错误走通用处理
|
|
||||||
handleRequestError(error);
|
|
||||||
return Promise.reject(error);
|
return Promise.reject(error);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@ -75,7 +75,7 @@ export const useTemplateStoryServiceHook = (): UseTemplateStoryService => {
|
|||||||
constraints: "",
|
constraints: "",
|
||||||
free_input_text: ""
|
free_input_text: ""
|
||||||
};
|
};
|
||||||
template.storyRole = [];
|
// template.storyRole = [];
|
||||||
}
|
}
|
||||||
if (template.id === 'e7438cd8-a23d-4974-8cde-13b5671b410c') {
|
if (template.id === 'e7438cd8-a23d-4974-8cde-13b5671b410c') {
|
||||||
template.freeInputItem = {
|
template.freeInputItem = {
|
||||||
@ -83,7 +83,10 @@ export const useTemplateStoryServiceHook = (): UseTemplateStoryService => {
|
|||||||
constraints: "",
|
constraints: "",
|
||||||
free_input_text: ""
|
free_input_text: ""
|
||||||
};
|
};
|
||||||
template.storyItem = [];
|
template.storyItem = [{
|
||||||
|
...template.storyItem[0],
|
||||||
|
item_name: "English word"
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -672,7 +672,7 @@ const RenderTemplateStoryMode = ({
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/** 自由输入文字 */}
|
{/* * 自由输入文字
|
||||||
{(selectedTemplate?.freeInputItem) && (
|
{(selectedTemplate?.freeInputItem) && (
|
||||||
<div className="py-2 flex-1 flex flex-col" style={{
|
<div className="py-2 flex-1 flex flex-col" style={{
|
||||||
height: 'calc(70vh - 300px - 8rem)'
|
height: 'calc(70vh - 300px - 8rem)'
|
||||||
@ -700,7 +700,7 @@ const RenderTemplateStoryMode = ({
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)} */}
|
||||||
|
|
||||||
{/* 角色自定义部分 - 精简布局 */}
|
{/* 角色自定义部分 - 精简布局 */}
|
||||||
{/* <div className="p-4">
|
{/* <div className="p-4">
|
||||||
@ -821,6 +821,28 @@ const RenderTemplateStoryMode = ({
|
|||||||
</div>
|
</div>
|
||||||
</div> */}
|
</div> */}
|
||||||
<div className=" absolute -bottom-8 right-0 w-full flex items-center justify-end gap-2">
|
<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
|
<ActionButton
|
||||||
isCreating={isTemplateCreating || localLoading > 0}
|
isCreating={isTemplateCreating || localLoading > 0}
|
||||||
handleCreateVideo={handleConfirm}
|
handleCreateVideo={handleConfirm}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import React, { useRef, useEffect, useState, SetStateAction, useMemo } from 'react';
|
import React, { useRef, useEffect, useState, SetStateAction, useMemo } from 'react';
|
||||||
import { motion, AnimatePresence } from 'framer-motion';
|
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 { ProgressiveReveal, presets } from '@/components/ui/progressive-reveal';
|
||||||
import { GlassIconButton } from '@/components/ui/glass-icon-button';
|
import { GlassIconButton } from '@/components/ui/glass-icon-button';
|
||||||
import { ScriptRenderer } from '@/components/script-renderer/ScriptRenderer';
|
import { ScriptRenderer } from '@/components/script-renderer/ScriptRenderer';
|
||||||
@ -605,7 +605,7 @@ export const MediaViewer = React.memo(function MediaViewer({
|
|||||||
{currentSketch.status === 2 && (
|
{currentSketch.status === 2 && (
|
||||||
<div className="absolute inset-0 bg-red-500/10 flex items-center justify-center">
|
<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">
|
<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>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user