不可见字符校验改为在前端页面校验
This commit is contained in:
@@ -280,9 +280,6 @@ public class BaseController {
|
|||||||
binder.registerCustomEditor(String.class, new PropertyEditorSupport() {
|
binder.registerCustomEditor(String.class, new PropertyEditorSupport() {
|
||||||
@Override
|
@Override
|
||||||
public void setAsText(String text) {
|
public void setAsText(String text) {
|
||||||
Pattern p = Pattern.compile("\t|\r|\n");
|
|
||||||
Matcher m = p.matcher(text);
|
|
||||||
text = m.replaceAll("");
|
|
||||||
setValue(text == null ? null : StringEscapeUtils.escapeHtml4(text.trim()));
|
setValue(text == null ? null : StringEscapeUtils.escapeHtml4(text.trim()));
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -173,6 +173,14 @@ jQuery.validator.addMethod("compareDate", function(value, element, param) {
|
|||||||
return true;
|
return true;
|
||||||
}, "结束时间不能早于开始时间");
|
}, "结束时间不能早于开始时间");
|
||||||
|
|
||||||
|
jQuery.validator.addMethod("invisibleChar", function(value, element) {
|
||||||
|
var reg = new RegExp(/\t|\r|\n/);
|
||||||
|
if (value.match(reg)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}, "请输入可见字符");
|
||||||
|
|
||||||
//掩码校验,超过两位不得以0开头
|
//掩码校验,超过两位不得以0开头
|
||||||
jQuery.validator.addMethod("notStartZero",function(value, element) {
|
jQuery.validator.addMethod("notStartZero",function(value, element) {
|
||||||
if(value.length>1&&value.length<6){
|
if(value.length>1&&value.length<6){
|
||||||
|
|||||||
@@ -61,6 +61,7 @@
|
|||||||
checkParent:"Configuration Type must match it's parent.",
|
checkParent:"Configuration Type must match it's parent.",
|
||||||
specServiceCodeCheck:"Protocol No is repeat.",
|
specServiceCodeCheck:"Protocol No is repeat.",
|
||||||
compareDate:"The end time should not be earlier than the start time.",
|
compareDate:"The end time should not be earlier than the start time.",
|
||||||
hexCheck:"Please enter the HEX format chatactar"
|
hexCheck:"Please enter the HEX format character",
|
||||||
|
invisibleChar:"Please enter the visible character"
|
||||||
});
|
});
|
||||||
}(jQuery));
|
}(jQuery));
|
||||||
|
|||||||
@@ -59,6 +59,7 @@
|
|||||||
checkParent:"Configuration Type must match it's parent.",
|
checkParent:"Configuration Type must match it's parent.",
|
||||||
specServiceCodeCheck:"Protocol No is repeat.",
|
specServiceCodeCheck:"Protocol No is repeat.",
|
||||||
compareDate:"The end time should not be earlier than the start time.",
|
compareDate:"The end time should not be earlier than the start time.",
|
||||||
hexCheck:"Please enter the HEX format chatactar"
|
hexCheck:"Please enter the HEX format character",
|
||||||
|
invisibleChar:"Please enter the visible character"
|
||||||
});
|
});
|
||||||
}(jQuery));
|
}(jQuery));
|
||||||
@@ -63,6 +63,7 @@
|
|||||||
checkParent:"配置类型必须与上级配置一致!",
|
checkParent:"配置类型必须与上级配置一致!",
|
||||||
specServiceCodeCheck:"协议号重复",
|
specServiceCodeCheck:"协议号重复",
|
||||||
compareDate:"结束时间不能早于开始时间",
|
compareDate:"结束时间不能早于开始时间",
|
||||||
hexCheck:"请输入十六进制字符"
|
hexCheck:"请输入十六进制字符",
|
||||||
|
invisibleChar:"请输入可见字符"
|
||||||
});
|
});
|
||||||
}(jQuery));
|
}(jQuery));
|
||||||
|
|||||||
@@ -407,6 +407,11 @@ $(function(){
|
|||||||
form.submit();
|
form.submit();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
$("#ipCfgFrom input, #cfgForm input").change(function(){
|
||||||
|
var s = $(this).val();
|
||||||
|
var ns = s.replace(/\t|\r|\n/mg, "");
|
||||||
|
$(this).val(ns);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
window.onload=function(){
|
window.onload=function(){
|
||||||
//日志查询IP类型增加格式提示
|
//日志查询IP类型增加格式提示
|
||||||
|
|||||||
Reference in New Issue
Block a user