diff --git a/.env.development b/.env.development index c4b938b..7409920 100644 --- a/.env.development +++ b/.env.development @@ -2,6 +2,7 @@ NEXT_PUBLIC_JAVA_URL = https://77.app.java.auth.qikongjian.com NEXT_PUBLIC_BASE_URL = https://77.smartvideo.py.qikongjian.com +NEXT_PUBLIC_CUT_URL = https://smartcut.movieflow.ai # NEXT_PUBLIC_JAVA_URL = https://test.java.movieflow.ai # NEXT_PUBLIC_BASE_URL = https://test.video.movieflow.ai # 失败率 diff --git a/.env.production b/.env.production index b960205..3bb1344 100644 --- a/.env.production +++ b/.env.production @@ -4,5 +4,6 @@ #NEXT_PUBLIC_BASE_URL = https://77.smartvideo.py.qikongjian.com NEXT_PUBLIC_JAVA_URL = https://auth.movieflow.ai NEXT_PUBLIC_BASE_URL = https://api.video.movieflow.ai +NEXT_PUBLIC_CUT_URL = https://smartcut.movieflow.ai # 失败率 NEXT_PUBLIC_ERROR_CONFIG = 0.2 diff --git a/components/pages/work-flow/ai-editing-iframe.tsx b/components/pages/work-flow/ai-editing-iframe.tsx index 597575a..8b18bfb 100644 --- a/components/pages/work-flow/ai-editing-iframe.tsx +++ b/components/pages/work-flow/ai-editing-iframe.tsx @@ -92,9 +92,11 @@ export const AIEditingIframe = React.forwardRef(null); const progressIntervalRef = useRef(null); const timeoutRef = useRef(null); + const cutUrl = process.env.NEXT_PUBLIC_CUT_URL || 'https://cut.movieflow.ai'; + console.log('cutUrl', cutUrl); // 构建智能剪辑URL - const aiEditingUrl = `https://smartcut.movieflow.ai/ai-editor/${projectId}?token=${token}&user_id=${userId}&auto=true&embedded=true`; + const aiEditingUrl = `${cutUrl}/ai-editor/${projectId}?token=${token}&user_id=${userId}&auto=true&embedded=true`; /** * 监听iframe消息 @@ -102,7 +104,7 @@ export const AIEditingIframe = React.forwardRef { const handleMessage = (event: MessageEvent) => { // 验证消息来源 - if (!event.origin.includes('smartcut.movieflow.ai')) { + if (!event.origin.includes(cutUrl)) { return; } diff --git a/components/pages/work-flow/use-workflow-data.tsx b/components/pages/work-flow/use-workflow-data.tsx index 766eb0d..ace46c5 100644 --- a/components/pages/work-flow/use-workflow-data.tsx +++ b/components/pages/work-flow/use-workflow-data.tsx @@ -21,6 +21,9 @@ export function useWorkflowData({ onEditPlanGenerated }: UseWorkflowDataProps = const useid = JSON.parse(localStorage.getItem("currentUser") || '{}').id || NaN; const notificationKey = useMemo(() => `video-workflow-${episodeId}`, [episodeId]); + const cutUrl = process.env.NEXT_PUBLIC_CUT_URL || 'https://cut.movieflow.ai'; + console.log('cutUrl', cutUrl); + useEffect(() => { console.log("init-useWorkflowData"); return () => { @@ -196,7 +199,7 @@ export function useWorkflowData({ onEditPlanGenerated }: UseWorkflowDataProps = }, [episodeId, onEditPlanGenerated, notificationKey]); const openEditPlan = useCallback(async () => { - window.open(`https://smartcut.movieflow.ai/ai-editor/${episodeId}?token=${token}&user_id=${useid}`, '_target'); + window.open(`${cutUrl}/ai-editor/${episodeId}?token=${token}&user_id=${useid}`, '_target'); }, [episodeId]); useEffect(() => {