修复相同appid不同版本数据混淆问题

This commit is contained in:
aixianling
2022-06-30 11:48:43 +08:00
parent e07aef9832
commit 11fbc716a0

View File

@@ -6,7 +6,7 @@ module.exports = {
action: "/node/wxmp/getZip", action: "/node/wxmp/getZip",
method: "post", method: "post",
execute: (request, response) => { execute: (request, response) => {
let {appid, id} = request.query, uniCon = `appid='${appid}' and pid='${id}'` let {appid, id} = request.query, uniCon = `appid='${appid}' and pid='${id}'`,uid= [aid, pid].join("_")
db.query(`select * from node_dvcp_config where id='${id}'`).then(res => { db.query(`select * from node_dvcp_config where id='${id}'`).then(res => {
let info = res?.[0], sql let info = res?.[0], sql
if (info?.appid && info?.pid) { if (info?.appid && info?.pid) {
@@ -18,7 +18,7 @@ module.exports = {
response.send({code: 0}) response.send({code: 0})
}, 2000)) }, 2000))
const path = info.projectPath || '/home/deploy/node-service/dvcp_v2_wechat', const path = info.projectPath || '/home/deploy/node-service/dvcp_v2_wechat',
dest = `/home/deploy/wxmpZips/${appid}/` dest = `/home/deploy/wxmpZips/${uid}/`
execute(`cd ${path}&&npm run apps&&node bin/pages.js ${appid}&&npm run build`) execute(`cd ${path}&&npm run apps&&node bin/pages.js ${appid}&&npm run build`)
.then(() => fse.emptyDir(dest)) .then(() => fse.emptyDir(dest))
.then(() => fse.copy(`${path}/dist/build/mp-weixin/`, dest)) .then(() => fse.copy(`${path}/dist/build/mp-weixin/`, dest))