diff --git a/src/rest/custom/download.js b/src/rest/custom/download.js index f3e6762..9379702 100644 --- a/src/rest/custom/download.js +++ b/src/rest/custom/download.js @@ -8,13 +8,13 @@ module.exports = { let id = request.query?.id dbUtils.detail({table: 'node_custom_config', id}).then(info => { if (info?.id) { - let path = `${info.dist}`, zipPath = `/home/deploy/node_deploy/zips/${info.id}.zip` + let path = `${info.dist || "../zips"}`, zipPath = `../zips/${info.id}.zip` fse.removeSync(zipPath) fse.pathExists(path, (err, exists) => { console.log(`${path}=========>${exists}`) if (exists) { execute(`cd ${path}&&zip -r ${info.id}.zip .`) - .then(() => execute(`cd ${path}&&mv ${info.id}.zip /home/deploy/node_deploy/zips`)) + .then(() => path == "../zips" ? execute(`cd ${path}&&mv ${info.id}.zip ../zips`) : 1) .then(() => { console.log('压缩完成!') setTimeout(() => {