diff --git a/src/rest/wechat/add.js b/src/rest/wechat/add.js index 487e8b3..bd57970 100644 --- a/src/rest/wechat/add.js +++ b/src/rest/wechat/add.js @@ -3,11 +3,11 @@ module.exports = { action: "/node/wxmp/addOrUpdate", method: "post", execute: (request, response) => { - let {appid, privateKey, projectPath, version, miniapp_appid} = request.body, - form = {appid, privateKey, projectPath, version}, sql + let {appid, privateKey, projectPath, version, miniapp_appid, id: pid} = request.body, + form = {appid, privateKey, projectPath, version, pid}, 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}'` + sql = `update node_wxmp_config set ${arr.join(",")} where appid='${form.appid}' and pid='${pid}'` } else {//新增 let cols = [], arr = [] form.appid = miniapp_appid