From 9ad3d6ed6a2e1322ee484fb23cd7ac7d68770696 Mon Sep 17 00:00:00 2001 From: fofolee Date: Mon, 24 Feb 2025 09:00:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BC=96=E6=8E=92=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=E8=84=9A=E6=9C=AC=E7=9A=84=E9=94=99=E8=AF=AF=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E8=A2=AB=E8=87=AA=E5=8A=A8=E6=8D=95=E6=8D=89=E7=9A=84?= =?UTF-8?q?BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/preload.js | 1 + src/components/CommandRunResult.vue | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin/preload.js b/plugin/preload.js index 77b7947..53460f6 100644 --- a/plugin/preload.js +++ b/plugin/preload.js @@ -151,6 +151,7 @@ let getSandboxFuns = () => { // 简化报错信息 let liteErr = (e) => { if (!e) return; + if (typeof e === "string") return e; return e.error ? e.error.stack.replace(/([ ] +at.+)|(.+\.js:\d+)/g, "").trim() : e.message; diff --git a/src/components/CommandRunResult.vue b/src/components/CommandRunResult.vue index 2cc4199..100fc09 100644 --- a/src/components/CommandRunResult.vue +++ b/src/components/CommandRunResult.vue @@ -296,7 +296,7 @@ export default { ? alert(stderr) : this.showRunResult(stderr, false); } - !options.action(stdout.toString()) || this.showRunResult(stdout, true); + !options.action(stdout?.toString()) || this.showRunResult(stdout, true); }, // 显示运行结果 async showRunResult(content, isSuccess) {