修复可视化编排的命令定时任务和主搜索框推送失效的BUG

This commit is contained in:
fofolee 2025-04-09 10:04:41 +08:00
parent 34230fa140
commit fcf3d5912e

View File

@ -16,6 +16,8 @@ import programmings from "./js/options/programs.js";
import defaultProfile from "./js/options/defaultProfile.js";
import Cron from "croner";
import QuickCommand from "components/quickcommandUI/QuickCommand";
import { generateFlowsCode } from "js/composer/generateCode";
// import autoDetach from "./js/autoDetach.js";
export default defineComponent({
@ -157,10 +159,13 @@ export default defineComponent({
reslove([`超过${timeout}ms未响应`]);
}, timeout);
let command = dbManager.getDB("qc_" + featureCode);
let commandCode = command.cmd;
let commandCode =
command.program === "quickcomposer"
? generateFlowsCode(command.flows)
: command.cmd;
if (mainInput)
commandCode = commandCode.replace(/\{\{input\}\}/g, mainInput);
if (command.program === "quickcommand") {
if (["quickcommand", "quickcomposer"].includes(command.program)) {
window.runCodeInSandbox(commandCode, (stdout, stderr) => {
stderr && reslove([stderr.toString()]);
reslove(stdout);