调整成功返回属性
This commit is contained in:
@@ -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)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user