From 64bd73db290b6d8a6434b5721bbdbafadae7179a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=B7=E9=BE=99?= Date: Sun, 31 Aug 2025 01:52:50 +0800 Subject: [PATCH 01/25] =?UTF-8?q?=E8=AF=B7=E6=B1=82=E9=82=AE=E7=AE=B1?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=EF=BC=8C=E6=94=B9=E4=B8=BApy=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/activate/page.tsx | 3 +-- components/ChatInputBox/ChatInputBox.tsx | 31 +++++++++++++++++++++--- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/app/activate/page.tsx b/app/activate/page.tsx index 5fdc04d..c55c2eb 100644 --- a/app/activate/page.tsx +++ b/app/activate/page.tsx @@ -30,8 +30,7 @@ function ConfirmEmail({ t }: { t: string }) { setMessage('Invalid verification token'); return; } - - post(`${process.env.NEXT_PUBLIC_JAVA_URL}/api/user/activate?t=${t}`) + post(`/auth/activate?t=${t}`) .then((res) => { setStatus('success'); setMessage('Your registration has been verified. Please return to the official website to log in.'); diff --git a/components/ChatInputBox/ChatInputBox.tsx b/components/ChatInputBox/ChatInputBox.tsx index d74bd03..12cff40 100644 --- a/components/ChatInputBox/ChatInputBox.tsx +++ b/components/ChatInputBox/ChatInputBox.tsx @@ -812,6 +812,24 @@ export function ChatInputBox({ noData }: { noData: boolean }) { videoDuration: "1min", }); + // 从 localStorage 初始化配置 + useEffect(() => { + const savedConfig = localStorage.getItem('videoFlowConfig'); + if (savedConfig) { + try { + const parsed = JSON.parse(savedConfig); + setConfigOptions({ + mode: parsed.mode || "auto", + resolution: parsed.resolution || "720p", + language: parsed.language || "english", + videoDuration: parsed.videoDuration || "1min", + }); + } catch (error) { + console.warn('解析保存的配置失败,使用默认配置:', error); + } + } + }, []); + // 配置项显示控制状态 const [showConfigOptions, setShowConfigOptions] = useState(false); @@ -918,9 +936,16 @@ export function ChatInputBox({ noData }: { noData: boolean }) {
- setConfigOptions((prev) => ({ ...prev, [key]: value })) - } + onConfigChange={(key, value) => { + setConfigOptions((prev) => { + const newConfig = { ...prev, [key]: value }; + // 保存到 localStorage + if (typeof window !== 'undefined') { + localStorage.setItem('videoFlowConfig', JSON.stringify(newConfig)); + } + return newConfig; + }); + }} />
)} From 787529fa18b30f2d804d5f7a52d2aac4ef4f4a6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8C=97=E6=9E=B3?= <7854742+wang_rumeng@user.noreply.gitee.com> Date: Sun, 31 Aug 2025 02:11:43 +0800 Subject: [PATCH 02/25] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=A1=B6=E9=83=A8?= =?UTF-8?q?=E5=AF=BC=E8=88=AA=E6=A0=8F=E5=92=8C=E5=AA=92=E4=BD=93=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E5=99=A8=EF=BC=8C=E6=B7=BB=E5=8A=A0=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=A0=87=E7=AD=BE=EF=BC=8C=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/layout/top-bar.tsx | 5 +++-- components/pages/work-flow/media-viewer.tsx | 17 ++++++++++++++++- components/pages/work-flow/task-info.tsx | 12 +----------- .../pages/work-flow/use-workflow-data.tsx | 15 ++++++++------- 4 files changed, 28 insertions(+), 21 deletions(-) diff --git a/components/layout/top-bar.tsx b/components/layout/top-bar.tsx index 5331f58..0aee37e 100644 --- a/components/layout/top-bar.tsx +++ b/components/layout/top-bar.tsx @@ -207,7 +207,7 @@ export function TopBar({ collapsed }: { collapsed: boolean }) { {isLogin ? ( -
+
{/* Pricing Link */} {pathname === "/" ? (
@@ -320,7 +321,7 @@ export function TopBar({ collapsed }: { collapsed: boolean }) {
{/* 操作按钮区域 */} -
+
+ */}
); } From 85f68a54621dcd597f81011edf95ea5b7be04a5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=B7=E9=BE=99?= Date: Sun, 31 Aug 2025 03:47:45 +0800 Subject: [PATCH 07/25] =?UTF-8?q?=E7=A6=BB=E8=B0=B1=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E8=A7=A3=E5=86=B3=E6=94=BE=E8=82=86=EF=BC=8C=E4=B8=8A?= =?UTF-8?q?=E7=BA=A7=E8=A6=81=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/request.ts | 1 + components/auth/auth-guard.tsx | 14 ++++++++++---- lib/auth.ts | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/api/request.ts b/api/request.ts index fc16b46..7a59dbf 100644 --- a/api/request.ts +++ b/api/request.ts @@ -50,6 +50,7 @@ request.interceptors.response.use( (response: AxiosResponse) => { // 检查业务状态码 if (response.data?.code !== 0 && response.data?.code !== 202) { + console.log('response', response) // 处理业务层面的错误 const businessCode = response.data?.code; const errorMessage = response.data?.message; diff --git a/components/auth/auth-guard.tsx b/components/auth/auth-guard.tsx index cc8c573..3ced090 100644 --- a/components/auth/auth-guard.tsx +++ b/components/auth/auth-guard.tsx @@ -2,8 +2,10 @@ import { useEffect, useState } from 'react'; import { useRouter, usePathname } from 'next/navigation'; -import { checkAuth, getUserProfile, isAuthenticated } from '@/lib/auth'; +import { checkAuth, clearAuthData, getUserProfile, isAuthenticated } from '@/lib/auth'; import GlobalLoad from '../common/GlobalLoad'; +import { message } from 'antd'; +import { errorHandle } from '@/api/errorHandle'; interface AuthGuardProps { children: React.ReactNode; @@ -42,9 +44,13 @@ export default function AuthGuard({ children }: AuthGuardProps) { } else { router.push('/login'); } - } catch (error) { - console.error('Auth verification failed:', error); - router.push('/login'); + } catch (errorCode:any) { + // 强制的领导要求,401和502都跳转到登录页 其他的不管 + if(errorCode.message == 401||errorCode.message == 502){ + router.push('/login'); + clearAuthData(); + } + errorHandle(errorCode.message) } finally { setIsLoading(false); } diff --git a/lib/auth.ts b/lib/auth.ts index f86bb5d..3faeef9 100644 --- a/lib/auth.ts +++ b/lib/auth.ts @@ -277,7 +277,7 @@ export const getUserProfile = async (): Promise => { }); if (!response.ok) { - throw new Error(`HTTP error! status: ${response.status}`); + throw new Error(response.status.toString()); } const data = await response.json(); From 9204a3e177a7ec556198a73e3784cce86c5be3f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8C=97=E6=9E=B3?= <7854742+wang_rumeng@user.noreply.gitee.com> Date: Sun, 31 Aug 2025 04:22:22 +0800 Subject: [PATCH 08/25] =?UTF-8?q?=E7=BB=99=E6=B6=88=E6=81=AFkey?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/SmartChatBox/MessageRenderer.tsx | 11 +++++++++-- components/SmartChatBox/SmartChatBox.tsx | 2 +- components/SmartChatBox/api.ts | 5 +++++ components/SmartChatBox/types.ts | 5 +++-- components/pages/work-flow/use-workflow-data.tsx | 2 +- 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/components/SmartChatBox/MessageRenderer.tsx b/components/SmartChatBox/MessageRenderer.tsx index 68bed03..de70028 100644 --- a/components/SmartChatBox/MessageRenderer.tsx +++ b/components/SmartChatBox/MessageRenderer.tsx @@ -1,6 +1,6 @@ import React, { useMemo } from "react"; import { motion } from "framer-motion"; -import { ChatMessage } from "./types"; +import { ChatMessage, MessageBlock } from "./types"; import { bubbleVariants, hhmm } from "./utils"; import { ProgressBar } from "./ProgressBar"; import { Loader2, AlertCircle, CheckCircle2 } from "lucide-react"; @@ -8,9 +8,10 @@ import { Image } from 'antd'; interface MessageRendererProps { msg: ChatMessage; + sendMessage: (blocks: MessageBlock[]) => Promise; } -export function MessageRenderer({ msg }: MessageRendererProps) { +export function MessageRenderer({ msg, sendMessage }: MessageRendererProps) { // Decide bubble style const isUser = msg.role === "user"; const isSystem = msg.role === "system"; @@ -75,6 +76,7 @@ export function MessageRenderer({ msg }: MessageRendererProps) { animate="visible" transition={{ duration: 0.25 }} data-alt="message-bubble" + key={msg.id} >
{/* Header */} @@ -126,6 +128,11 @@ export function MessageRenderer({ msg }: MessageRendererProps) { return ; case "link": return {b.text}; + case "applyButton": + return ; default: return null; } diff --git a/components/SmartChatBox/SmartChatBox.tsx b/components/SmartChatBox/SmartChatBox.tsx index 5d0ac65..ff7a812 100644 --- a/components/SmartChatBox/SmartChatBox.tsx +++ b/components/SmartChatBox/SmartChatBox.tsx @@ -161,7 +161,7 @@ export default function SmartChatBox({ {group.messages.map((message) => ( - + ))} ))} diff --git a/components/SmartChatBox/api.ts b/components/SmartChatBox/api.ts index 11b6363..6804d64 100644 --- a/components/SmartChatBox/api.ts +++ b/components/SmartChatBox/api.ts @@ -239,6 +239,11 @@ function transformMessage(apiMessage: RealApiMessage): ChatMessage { message.blocks.push({ type: "link", text: c.content, url: c.url || '' }); } }); + + // todo: 需要确认是否需要添加applyButton + // if (role === 'assistant' && function_name === 'modify_video_with_runway') { + // message.blocks.push({ type: "applyButton", text: "Apply" }); + // } } catch (error) { // 如果 JSON 解析失败,将整个 content 作为文本内容 message.blocks.push({ type: "text", text: content }); diff --git a/components/SmartChatBox/types.ts b/components/SmartChatBox/types.ts index c9a1040..c37dbea 100644 --- a/components/SmartChatBox/types.ts +++ b/components/SmartChatBox/types.ts @@ -8,7 +8,8 @@ export type MessageBlock = | { type: "video"; url: string; poster?: string } | { type: "audio"; url: string } | { type: "progress"; value: number; total?: number; label?: string } - | { type: "link"; text: string; url: string }; + | { type: "link"; text: string; url: string } + | { type: "applyButton"; text: string; } export interface ChatMessage { id: string; @@ -80,7 +81,7 @@ export interface MessagesResponse { } type ContentType = "text" | "image" | "video" | "audio"; -export type FunctionName = "create_project" | "generate_script_summary" | "generate_character" | "generate_sketch" | "generate_shot_sketch" | "generate_video"; +export type FunctionName = "create_project" | "generate_script_summary" | "generate_character" | "generate_sketch" | "generate_shot_sketch" | "generate_video" | "modify_video_with_runway"; // 项目创建 export interface ProjectInit { diff --git a/components/pages/work-flow/use-workflow-data.tsx b/components/pages/work-flow/use-workflow-data.tsx index e8e2eda..b5d4e3e 100644 --- a/components/pages/work-flow/use-workflow-data.tsx +++ b/components/pages/work-flow/use-workflow-data.tsx @@ -115,7 +115,7 @@ export function useWorkflowData() { const generateEditPlan = useCallback(async (isInit?: boolean) => { isInit && await getGenerateEditPlan({ project_id: episodeId }); - window.open(`https://smartcut.huiying.video/ai-editor/${episodeId}?token=${token}&user_id=${useid}`, '_target'); + window.open(`https://smartcut.movieflow.ai/editor/${episodeId}?token=${token}&user_id=${useid}`, '_target'); }, [episodeId]); useEffect(() => { From 8228028fa40b93c07b2ea7c0d5ff75a269fa84b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8C=97=E6=9E=B3?= <7854742+wang_rumeng@user.noreply.gitee.com> Date: Sun, 31 Aug 2025 04:30:01 +0800 Subject: [PATCH 09/25] =?UTF-8?q?chatbox=E9=A2=84=E8=A7=88=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/SmartChatBox/MessageRenderer.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/components/SmartChatBox/MessageRenderer.tsx b/components/SmartChatBox/MessageRenderer.tsx index de70028..cd99578 100644 --- a/components/SmartChatBox/MessageRenderer.tsx +++ b/components/SmartChatBox/MessageRenderer.tsx @@ -102,7 +102,17 @@ export function MessageRenderer({ msg, sendMessage }: MessageRendererProps) { case "image": return (
- {b.alt + {b.alt document.querySelector('[data-alt="smart-chat-box"]') || document.body, + mask:
, + maskClassName: "!bg-black/60", + rootClassName: "!z-[1000]" + }} + />
); case "video": From c912e0da928a77428a666e26923ff2bb94910477 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=B7=E9=BE=99?= Date: Sun, 31 Aug 2025 04:43:14 +0800 Subject: [PATCH 10/25] =?UTF-8?q?=E6=96=87=E6=A1=88=E8=B0=83=E6=95=B4+-?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/layout.tsx | 2 +- components/ChatInputBox/ChatInputBox.tsx | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/layout.tsx b/app/layout.tsx index 232e151..1dd6e9c 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -39,7 +39,7 @@ export default function RootLayout({ return ( - MovieFlow - AI Film Studio + MovieFlow - AI Movie Studio diff --git a/components/ChatInputBox/ChatInputBox.tsx b/components/ChatInputBox/ChatInputBox.tsx index 12cff40..8e4b474 100644 --- a/components/ChatInputBox/ChatInputBox.tsx +++ b/components/ChatInputBox/ChatInputBox.tsx @@ -17,6 +17,7 @@ import { ImagePlay, Sparkles, Settings, + MoreHorizontal, } from "lucide-react"; import { Dropdown, @@ -968,7 +969,7 @@ export function ChatInputBox({ noData }: { noData: boolean }) { {!isExpanded && (
{/* 第一行:输入框 */} -
+
{/* 文本输入框 - 改为textarea */}