fix: 修复schema字段变动导致模糊搜索不能识别的问题

This commit is contained in:
刘洪洪
2024-01-30 10:30:03 +08:00
parent 9e8b3e9d64
commit cca54359a8

View File

@@ -1285,7 +1285,7 @@ export default class Parser {
}
if (regexIPv4.test(str) || regexIPv6.test(str)) {
const obj = this.columnList.find(t => t.label.toLowerCase() === 'ip')
const obj = this.columnList.find(t => t.label.toLowerCase() === 'ip' || t.label.toLowerCase() === 'ip.addr')
if (obj) {
return `${obj.label}='${str}'`
} else {
@@ -1296,7 +1296,7 @@ export default class Parser {
}
} else if (regexDomain.test(str)) {
// 只写作domain即可schema字段更改几次避免后续再更改直接拿this.columnList的label进行替换
const obj = this.columnList.find(t => t.label.toLowerCase() === 'domain')
const obj = this.columnList.find(t => t.label.toLowerCase() === 'domain' || t.label.toLowerCase() === 'domain.name')
if (obj) {
return `${obj.label} LIKE '%${str}'`
} else {
@@ -1306,7 +1306,7 @@ export default class Parser {
return str
}
} else {
const obj = this.columnList.find(t => t.label.toLowerCase() === 'app')
const obj = this.columnList.find(t => t.label.toLowerCase() === 'app' || t.label.toLowerCase() === 'app.name')
if (obj) {
return `${obj.label} LIKE '%${str}%'`
} else {