定制方案全新升级

This commit is contained in:
aixianling
2022-07-14 18:01:25 +08:00
parent 21102cdfe2
commit 96854369a1
3 changed files with 5 additions and 4 deletions

View File

@@ -15,7 +15,7 @@ module.exports = {
]).then(() => {
data.appList = data.appList.filter(Boolean).map(e => {
if (data.type == 'mp') {
e.tabbar = e.id == data.extra?.tabBar.list?.[2].id
e.tabbar = e.id == data.extra?.tabBar.list?.[2]?.id
}
return e
})

View File

@@ -2,6 +2,7 @@ const db = require("../../utils/dbUitls");
const execute = require("../../tools/exec")
const dayjs = require("dayjs")
const fse = require("fs-extra");
const isDev = process.env.OS == 'Windows_NT'
module.exports = {
action: "/node/wxmp/getZip",
method: "post",
@@ -17,8 +18,8 @@ module.exports = {
db.query(sql).then(() => setTimeout(() => {
response.send({code: 0})
}, 2000))
const path = info.projectPath || '/home/deploy/node-service/dvcp_v2_wechat',
dest = `/home/deploy/wxmpZips/${uid}/`,
const path = info.projectPath || isDev ? 'E:\\code\\cunwei\\dvcp_v2_wechat' : '/home/deploy/node-service/dvcp_v2_wechat',
dest = isDev ? `E:\\wxmpZips\\${uid}` : `/home/deploy/wxmpZips/${uid}/`,
processEnv = info.npmScript || 'build',
dist = info.npmScript ? `${path}/dist/${info.npmScript}/` : `${path}/dist/build/mp-weixin/`
execute(`cd ${path}&&npm run apps&&node bin/pages.js ${appid} ${id}&&npm run ${processEnv}`)

View File

@@ -1,6 +1,6 @@
const {exec} = require("child_process");
const execute = cmd => new Promise((resolve, reject) => {
let pid = exec(cmd, (err) => {
let pid = exec(cmd, {windowsHide: true}, (err) => {
if (!err) {
resolve()
} else reject(err)