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( `