This commit is contained in:
949036910@qq.com
2026-05-28 20:59:42 +08:00
parent d71a654cf1
commit fa467b65b6
6 changed files with 116 additions and 20 deletions

View File

@@ -1,6 +1,7 @@
<script setup>
import { ref } from "vue";
import { storeToRefs } from "pinia";
import { invoke } from "@tauri-apps/api/core";
import { useWorkflowStore, executeVideoRewrite } from "../../stores/workflow.js";
const workflow = useWorkflowStore();
@@ -24,6 +25,7 @@ function onCancel() {
feedback.value = { severity: "", message: "" };
if (videoRewriting.value) {
workflow.videoRewriteAbortRequested = true;
invoke("stop_nodejs_script", { scriptName: "douyin_pipeline.js" }).catch(() => {});
workflow.videoRewriting = false;
workflow.rewriteProgress = "";
}
@@ -31,11 +33,7 @@ function onCancel() {
}
function onVisibleChange(visible) {
if (visible) {
workflow.videoLinkModalVisible = true;
return;
}
onCancel();
if (!visible) onCancel();
}
async function onRewrite() {

View File

@@ -856,6 +856,9 @@ export async function executeVideoRewrite(store) {
};
} catch (err) {
const msg = err instanceof Error ? err.message : String(err || "未知错误");
if (store.videoRewriteAbortRequested || String(msg).includes("任务已取消")) {
return { ok: false, cancelled: true, message: "已取消仿写任务" };
}
return { ok: false, message: `仿写失败: ${msg}` };
} finally {
if (typeof unlisten === "function") {