新版小程序打包

This commit is contained in:
aixianling
2022-12-23 18:02:51 +08:00
parent 16b37d68c0
commit dfc4b7a84b
5 changed files with 49 additions and 54 deletions

21
src/rest/wechat/sync.js Normal file
View File

@@ -0,0 +1,21 @@
const dbUtils = require("../../utils/dbUitls");
uid = e => [e.appid, e.corpId].join("_")
module.exports = {
action: "/node/wxmp/sync",
method: "post",
execute: (request, response) => {
let records = {}, meta = []
Promise.all([
dbUtils.query("select * from app_dvcp_config").then(res => meta = res),
dbUtils.query("select * from node_wxmp_deploy").then(res => res?.map(e => records[uid(e)] = e))
]).then(() => Promise.all(meta.map(e => {
const {name, miniapp_appid: appid, corp_id: corpId, web_url: webUrl} = e
const id = records[uid({appid, corpId})]?.id
delete e.system_info
return dbUtils.addOrUpdate({
table: 'node_wxmp_deploy',
form: {id, name, appid, corpId, webUrl, dvcpConfig: e}
})
}))).finally(() => response.send({code: 0, data: ""}))
}
}