diff --git a/apps/web/src/pages/editing-planner/components/TtsPanel/hooks/useTtsPanel.ts b/apps/web/src/pages/editing-planner/components/TtsPanel/hooks/useTtsPanel.ts index 6d3021f55..27ab249d8 100644 --- a/apps/web/src/pages/editing-planner/components/TtsPanel/hooks/useTtsPanel.ts +++ b/apps/web/src/pages/editing-planner/components/TtsPanel/hooks/useTtsPanel.ts @@ -60,7 +60,6 @@ export const useTtsPanel = ({ open, config, onChange, onClose }: UseTtsPanelOpti return () => { active = false } - // eslint-disable-next-line react-hooks/exhaustive-deps }, [open]) /* ── 组件卸载时清理音频资源 ── */ diff --git a/apps/web/src/pages/generate/GeneratePage.tsx b/apps/web/src/pages/generate/GeneratePage.tsx index 749d8c2db..768536f99 100644 --- a/apps/web/src/pages/generate/GeneratePage.tsx +++ b/apps/web/src/pages/generate/GeneratePage.tsx @@ -224,21 +224,23 @@ const GeneratePage: React.FC = () => { /> )} - {/* 正式生成结果 */} - { - setPreviewVideo(video) - setPreviewModalOpen(true) - }} - onDownload={handleDownload} - onShare={handleShare} - onGoToLibrary={() => navigate("/app/products")} - /> + {/* 正式生成结果(Step4+ 才显示) */} + {currentStep >= 4 && ( + { + setPreviewVideo(video) + setPreviewModalOpen(true) + }} + onDownload={handleDownload} + onShare={handleShare} + onGoToLibrary={() => navigate("/app/products")} + /> + )} diff --git a/apps/web/src/pages/generate/components/Step3GeneratePreview.tsx b/apps/web/src/pages/generate/components/Step3GeneratePreview.tsx index 4505f67eb..e13441ad2 100644 --- a/apps/web/src/pages/generate/components/Step3GeneratePreview.tsx +++ b/apps/web/src/pages/generate/components/Step3GeneratePreview.tsx @@ -27,9 +27,9 @@ interface Step3GeneratePreviewProps { } const Step3GeneratePreview: React.FC = ({ - templateName, - materialCount, - videoRatio, + templateName: _templateName, + materialCount: _materialCount, + videoRatio: _videoRatio, previewStatus, previewResult, previewError, @@ -119,48 +119,6 @@ const Step3GeneratePreview: React.FC = ({ preload="metadata" /> - - {/* 剪辑方案信息 */} -
-
剪辑方案信息
-
-
- 模板 - {templateName} -
-
- 素材数量 - {materialCount} -
-
- 片段数 - {previewResult.clipCount} 段 -
-
- 转场次数 - {previewResult.transitionCount} 次 -
-
- 素材使用率 - {previewResult.materialUsage}% -
-
- 实际时长 - - {(typeof previewResult.duration === "number" - ? previewResult.duration - : 0 - ).toFixed(1)}{" "} - 秒 - -
-
- 视频比例 - {videoRatio} -
-
-
💡 这是 480p 预览版,正式生成将输出高清视频
-
)} diff --git a/apps/web/src/router/ProtectedRoute.tsx b/apps/web/src/router/ProtectedRoute.tsx index b1f2fa12f..2c49851ff 100644 --- a/apps/web/src/router/ProtectedRoute.tsx +++ b/apps/web/src/router/ProtectedRoute.tsx @@ -3,7 +3,6 @@ import { Navigate } from "react-router-dom" import { useAuthStore } from "@/store/authStore" /** 受保护的路由组件 */ -// eslint-disable-next-line react-refresh/only-export-components export const ProtectedRoute = ({ children }: { children: React.ReactNode }) => { const isAuthenticated = useAuthStore((state) => state.isAuthenticated) const hasAccessToken = Boolean(localStorage.getItem("access_token")) diff --git a/apps/web/src/test/api/client.test.ts b/apps/web/src/test/api/client.test.ts index b9986ee12..d38297266 100644 --- a/apps/web/src/test/api/client.test.ts +++ b/apps/web/src/test/api/client.test.ts @@ -26,12 +26,10 @@ import { refreshAccessToken } from "@/api/auth" import apiClient from "@/api/client" // 从真实实例取出拦截器回调 -// eslint-disable-next-line @typescript-eslint/no-explicit-any const requestHandlers = (apiClient as any).interceptors.request.handlers as Array<{ fulfilled: (config: unknown) => unknown rejected: (error: unknown) => unknown }> -// eslint-disable-next-line @typescript-eslint/no-explicit-any const responseHandlers = (apiClient as any).interceptors.response.handlers as Array<{ fulfilled: (response: unknown) => unknown rejected: (error: unknown) => Promise @@ -258,7 +256,6 @@ describe("apiClient - 401 token refresh", () => { isAuthenticated: false, clearAuth: mockClearAuth, setAuth: vi.fn(), - // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any) const err = makeAxiosError(401, { detail: "Unauthorized" }) @@ -276,7 +273,6 @@ describe("apiClient - 401 token refresh", () => { isAuthenticated: true, clearAuth: vi.fn(), setAuth: mockSetAuth, - // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any) vi.mocked(refreshAccessToken).mockResolvedValue({ access_token: "new-access", @@ -306,7 +302,6 @@ describe("apiClient - 401 token refresh", () => { isAuthenticated: true, clearAuth: mockClearAuth, setAuth: vi.fn(), - // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any) vi.mocked(refreshAccessToken).mockRejectedValue(new Error("refresh failed") as never) diff --git a/apps/web/src/test/setup.ts b/apps/web/src/test/setup.ts index ae3c9729c..69181c10d 100644 --- a/apps/web/src/test/setup.ts +++ b/apps/web/src/test/setup.ts @@ -32,9 +32,7 @@ afterEach(() => { declare global { // eslint-disable-next-line @typescript-eslint/no-namespace namespace Vi { - // eslint-disable-next-line @typescript-eslint/no-explicit-any interface Assertion extends jest.Matchers {} - // eslint-disable-next-line @typescript-eslint/no-explicit-any interface AsymmetricMatchersContaining extends jest.Matchers {} } }