From 6263a27abab317fba7fc787bda48e7f6b9b98f53 Mon Sep 17 00:00:00 2001 From: aixianling Date: Thu, 30 Jun 2022 15:21:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8C=87=E5=AE=9Anpm?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/rest/wechat/add.js | 4 ++-- src/rest/wechat/getZip.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/rest/wechat/add.js b/src/rest/wechat/add.js index bd57970..410da59 100644 --- a/src/rest/wechat/add.js +++ b/src/rest/wechat/add.js @@ -3,8 +3,8 @@ module.exports = { action: "/node/wxmp/addOrUpdate", method: "post", execute: (request, response) => { - let {appid, privateKey, projectPath, version, miniapp_appid, id: pid} = request.body, - form = {appid, privateKey, projectPath, version, pid}, sql + let {appid, privateKey, projectPath, version, miniapp_appid, id: pid, npmScript} = request.body, + form = {appid, privateKey, projectPath, version, pid, npmScript}, sql if (form.appid) {//编辑 let arr = Object.keys(form).filter(e => form[e]).map(e => `${e}='${form[e]}'`) sql = `update node_wxmp_config set ${arr.join(",")} where appid='${form.appid}' and pid='${pid}'` diff --git a/src/rest/wechat/getZip.js b/src/rest/wechat/getZip.js index 8ac67a6..7c866d0 100644 --- a/src/rest/wechat/getZip.js +++ b/src/rest/wechat/getZip.js @@ -19,7 +19,7 @@ module.exports = { }, 2000)) const path = info.projectPath || '/home/deploy/node-service/dvcp_v2_wechat', dest = `/home/deploy/wxmpZips/${uid}/` - execute(`cd ${path}&&npm run apps&&node bin/pages.js ${appid} ${id}&&npm run build`) + execute(`cd ${path}&&npm run apps&&node bin/pages.js ${appid} ${id}&&npm run ${info.npmScript || 'build'}`) .then(() => fse.emptyDir(dest)) .then(() => fse.copy(`${path}/dist/build/mp-weixin/`, dest)) .then(() => fse.emptyDir(`${path}/dist/build`))