1
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user