From 95feb6ac81591a31f5d766dfe8146ffc12608317 Mon Sep 17 00:00:00 2001 From: wenlele Date: Thu, 21 Dec 2023 11:20:20 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E7=82=B9=E6=B5=8B=E7=82=B9=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/project/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/api/app/lib/controllers/project/index.js b/api/app/lib/controllers/project/index.js index 5c13fa1..ef5ae20 100644 --- a/api/app/lib/controllers/project/index.js +++ b/api/app/lib/controllers/project/index.js @@ -425,8 +425,14 @@ async function getStructureStation (ctx) { } } - let attention = `AND positionCaseInsensitive(toString(t_sensor.labels), '${traitLabel}') > 0` + let trait = traitLabel + if (traitLabel && /['"]/.test(trait)) { + trait = trait.replace(/['"]/g, ''); // 去掉引号 + } + let attention = `AND positionCaseInsensitive(toString(t_sensor.labels), '${trait}') > 0` + console.log(111, trait, attention); + const sensor = strucId.length ? await clickHouse.anxinyun.query( `