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

This commit is contained in:
aixianling
2022-06-30 14:08:49 +08:00
parent 8b19051578
commit 00cc2d9e4f
2 changed files with 4 additions and 4 deletions

View File

@@ -3,8 +3,8 @@ module.exports = {
action: "/node/wxmp/detail",
method: "post",
execute: (request, response) => {
let {appid} = request.query
dbUtils.query(`select * from node_dvcp_config where appid='${appid}' limit 0,1`).then(res => {
let {appid, pid} = request.query
dbUtils.query(`select * from node_dvcp_config where appid='${appid}' and pid='${pid}' limit 0,1`).then(res => {
response.send({
code: 0,
data: res?.[0]

View File

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