优化打包下载

This commit is contained in:
aixianling
2022-06-10 15:17:07 +08:00
parent d813628d61
commit 29701488e0

View File

@@ -11,7 +11,9 @@ module.exports = {
fse.pathExists(path, (err, exists) => {
console.log(`${path}=========>${exists}`)
if (exists) {
execute(`cd /root/node-service/wxmpZips&&zip -r ${appid}.zip ${path}`).then(() => {
execute(`cd ${path}&&zip -r ${appid}.zip .`)
.then(() => execute(`cd ${path}&&mv ${appid}.zip /root/node-service/wxmpZips`))
.then(() => {
console.log('压缩完成!')
setTimeout(() => {
response.download(zipPath)