修复下载无法使用问题
This commit is contained in:
@@ -2,6 +2,7 @@ const dbUtils = require("../../utils/dbUitls");
|
|||||||
const archiver = require("archiver")
|
const archiver = require("archiver")
|
||||||
const fse = require("fs-extra");
|
const fse = require("fs-extra");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
|
const dir = require("path")
|
||||||
module.exports = {
|
module.exports = {
|
||||||
action: "/node/autodeploy/download",
|
action: "/node/autodeploy/download",
|
||||||
method: "post",
|
method: "post",
|
||||||
@@ -27,7 +28,9 @@ module.exports = {
|
|||||||
arc.directory(path, false)
|
arc.directory(path, false)
|
||||||
arc.finalize().then(() => {
|
arc.finalize().then(() => {
|
||||||
console.log('压缩完成!')
|
console.log('压缩完成!')
|
||||||
response.download(zipPath, `${info.id}.zip`)
|
setTimeout(() => {
|
||||||
|
response.download(zipPath)
|
||||||
|
}, 500)
|
||||||
})
|
})
|
||||||
} else response.send({code: 1, err: "没有打包文件!"})
|
} else response.send({code: 1, err: "没有打包文件!"})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user