From aef22a3b14e1fc0dc8630fe4d0102bdaa0a91674 Mon Sep 17 00:00:00 2001 From: kubbo <390378816@qq.com> Date: Thu, 16 Feb 2023 10:39:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=88=90=E5=8A=9F=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/websocket/custom/getZip.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/websocket/custom/getZip.js b/src/websocket/custom/getZip.js index 373557b..b8ce7d4 100644 --- a/src/websocket/custom/getZip.js +++ b/src/websocket/custom/getZip.js @@ -26,13 +26,14 @@ const handleZip = (id, ws) => { }, 4000) } - stop() { + stop(row) { if (this.timer) clearInterval(this.timer) + sendMessage({code: 1, row}) } - finish(remark) { + finish(row) { if (this.timer) clearInterval(this.timer) - sendMessage({code: 0, progress: 100, remark}) + sendMessage({code: 0, progress: 100, row}) } } @@ -57,11 +58,10 @@ const handleZip = (id, ws) => { .then(row => progress.finish(row)) .catch(err => { console.log(err) - progress.stop() const msg = `执行失败:${err.cmd}` return db.query(`update node_custom_config set error='${msg}',zipTime=null where ${uniCon}`) .then(() => db.detail({table: "node_custom_config", id})) - .then(row => sendMessage({code: 1, row})) + .then(row => progress.stop(row)) .catch(() => 0) }) }