优化打包下载
This commit is contained in:
@@ -14,7 +14,9 @@ module.exports = {
|
|||||||
fse.pathExists(path, (err, exists) => {
|
fse.pathExists(path, (err, exists) => {
|
||||||
console.log(`${path}=========>${exists}`)
|
console.log(`${path}=========>${exists}`)
|
||||||
if (exists) {
|
if (exists) {
|
||||||
execute(`cd /root/node-service/zips&&zip -r ${info.id}.zip ${path}`).then(() => {
|
execute(`cd ${path}&&zip -r ${info.id}.zip .`)
|
||||||
|
.then(() => execute(`cd ${path}&&mv ${info.id}.zip /root/node-service/zips`))
|
||||||
|
.then(() => {
|
||||||
console.log('压缩完成!')
|
console.log('压缩完成!')
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
response.download(zipPath)
|
response.download(zipPath)
|
||||||
|
|||||||
Reference in New Issue
Block a user