mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-04 21:19:52 +08:00
fix(测试计划): 修复测试计划场景无法精确查找sql特殊字符的缺陷
--bug=1044202 --user=宋天阳 https://www.tapd.cn/55049933/s/1550788
This commit is contained in:
parent
02b93ec4f3
commit
1d145dd6e6
@ -23,13 +23,18 @@ public class BaseCondition {
|
||||
|
||||
// 转JSON时会调用。 前台数据传过来时可以顺便处理掉转义字符
|
||||
public void setKeyword(String keyword) {
|
||||
keyword = StringUtils.replace(keyword, "%", "\\%");
|
||||
keyword = StringUtils.replace(keyword, "_", "\\_");
|
||||
//判断之前有没有转义过。转义过就不再转义。耍花活的自己想办法解决
|
||||
if (StringUtils.contains(keyword, "%") && !StringUtils.contains(keyword, "\\%")) {
|
||||
keyword = StringUtils.replace(keyword, "%", "\\%");
|
||||
}
|
||||
if (StringUtils.contains(keyword, "_") && !StringUtils.contains(keyword, "\\_")) {
|
||||
keyword = StringUtils.replace(keyword, "_", "\\_");
|
||||
}
|
||||
this.keyword = keyword;
|
||||
}
|
||||
|
||||
// 直接初始化keyword
|
||||
public void initKeyword(String keyword) {
|
||||
// 直接初始化keyword
|
||||
this.keyword = keyword;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user