diff --git a/src/rest/wechat/getZip.js b/src/rest/wechat/getZip.js index 54cf7bb..a0321f7 100644 --- a/src/rest/wechat/getZip.js +++ b/src/rest/wechat/getZip.js @@ -17,10 +17,12 @@ module.exports = { db.query(sql).then(() => setTimeout(() => { response.send({code: 0}) }, 2000)) - execute(`cd ${info.projectPath || '/root/node-service/dvcp_v2_wechat'}&&npm run apps&&node bin/pages.js ${id}&&npm run build`) - .then(() => fse.emptyDir(`../wxmpZips/${id}/`)) - .then(() => fse.copy(`${info.projectPath || '/root/node-service/dvcp_v2_wechat'}/dist/build/mp-weixin/`, `../wxmpZips/${id}/`)) - .then(() => fse.emptyDir(`${info.projectPath || '/root/node-service/dvcp_v2_wechat'}/dist/build`)) + const path = info.projectPath || '/home/deploy/node-service/dvcp_v2_wechat', + dest = `/home/deploy/wxmpZips/${id}/` + execute(`cd ${path}&&npm run apps&&node bin/pages.js ${id}&&npm run build`) + .then(() => fse.emptyDir(dest)) + .then(() => fse.copy(`${path}/dist/build/mp-weixin/`, dest)) + .then(() => fse.emptyDir(`${path}/dist/build`)) .then(() => { db.query(`update node_wxmp_config set error='ζ‰“εŒ…ζ—Άι—΄:${dayjs().format("YYYY-MM-DD HH:mm:ss")}' where appid='${info.appid}'`) }).catch(err => {