From 00e1fc04de881412056aedd95f0557282313ef7f Mon Sep 17 00:00:00 2001 From: aixianling Date: Fri, 17 Jun 2022 14:24:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E6=89=93=E5=8C=85=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E5=88=B0/home/deploy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/rest/wechat/getZip.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 => {