From 7dd22f51fe0ed2eeef4a37564b8880bc7cb1f0dd Mon Sep 17 00:00:00 2001 From: aixianling Date: Mon, 4 Jul 2022 17:50:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=A6=E6=83=85=E5=A2=9E=E5=8A=A0=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E5=BA=93=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/rest/custom/detail.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/rest/custom/detail.js b/src/rest/custom/detail.js index 8e48519..f952aa6 100644 --- a/src/rest/custom/detail.js +++ b/src/rest/custom/detail.js @@ -5,8 +5,15 @@ module.exports = { execute: (request, response) => { let {id} = request.query dbUtils.detail({table: 'node_custom_config', id}).then(data => { - data.apps && (data.apps = JSON.parse(data.apps)) - response.send({code: 0, data}) + if (data.apps) { + data.apps = JSON.parse(data.apps) + if (data.apps?.length > 0) + dbUtils.query(`select * from node_wechat_apps where id in (${data.apps.map(e=>`'${e}'`)?.toString()})`).then(res => { + data.appList = res + response.send({code: 0, data}) + }) + else response.send({code: 0, data}) + } else response.send({code: 0, data}) }).catch(err => { response.send({code: 1, err: err?.sqlMessage || err || ""}) })