修复下载无法使用问题

This commit is contained in:
aixianling
2022-04-01 16:48:42 +08:00
parent 948cc94338
commit 1f0bf4cf73

View File

@@ -2,6 +2,7 @@ const dbUtils = require("../../utils/dbUitls");
const archiver = require("archiver")
const fse = require("fs-extra");
const fs = require("fs");
const dir = require("path")
module.exports = {
action: "/node/autodeploy/download",
method: "post",
@@ -27,7 +28,9 @@ module.exports = {
arc.directory(path, false)
arc.finalize().then(() => {
console.log('压缩完成!')
response.download(zipPath, `${info.id}.zip`)
setTimeout(() => {
response.download(zipPath)
}, 500)
})
} else response.send({code: 1, err: "没有打包文件!"})
})