不可见字符校验改为在前端页面校验
This commit is contained in:
@@ -280,9 +280,6 @@ public class BaseController {
|
||||
binder.registerCustomEditor(String.class, new PropertyEditorSupport() {
|
||||
@Override
|
||||
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()));
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -173,6 +173,14 @@ jQuery.validator.addMethod("compareDate", function(value, element, param) {
|
||||
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开头
|
||||
jQuery.validator.addMethod("notStartZero",function(value, element) {
|
||||
if(value.length>1&&value.length<6){
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
checkParent:"Configuration Type must match it's parent.",
|
||||
specServiceCodeCheck:"Protocol No is repeat.",
|
||||
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));
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
checkParent:"Configuration Type must match it's parent.",
|
||||
specServiceCodeCheck:"Protocol No is repeat.",
|
||||
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));
|
||||
@@ -63,6 +63,7 @@
|
||||
checkParent:"配置类型必须与上级配置一致!",
|
||||
specServiceCodeCheck:"协议号重复",
|
||||
compareDate:"结束时间不能早于开始时间",
|
||||
hexCheck:"请输入十六进制字符"
|
||||
hexCheck:"请输入十六进制字符",
|
||||
invisibleChar:"请输入可见字符"
|
||||
});
|
||||
}(jQuery));
|
||||
|
||||
@@ -407,6 +407,11 @@ $(function(){
|
||||
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(){
|
||||
//日志查询IP类型增加格式提示
|
||||
|
||||
Reference in New Issue
Block a user