From bfaa681811dd1e2f69cdd75177898c70b6f521dc Mon Sep 17 00:00:00 2001 From: wangxin Date: Thu, 18 Oct 2018 10:45:18 +0800 Subject: [PATCH] =?UTF-8?q?(1)=E7=AB=AF=E5=8F=A3=E6=8E=A9=E7=A0=81?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E4=B8=AD=E7=9A=84=E7=AB=AF=E5=8F=A3=E9=83=A8?= =?UTF-8?q?=E5=88=86=E5=8D=8F=E8=AE=AE=E9=9D=9ETCP,UDP=E6=98=AF=E5=8A=A0?= =?UTF-8?q?=E5=85=A5=E9=9D=9E0=E6=A0=A1=E9=AA=8C=20(2)IP=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E6=81=A2=E5=A4=8D=E8=B5=B7=E5=A7=8BIP=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E7=9B=B8=E5=90=8C=E7=9A=84=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../1.11.0/jquery.validate.method.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js index 4ba9e7039..e901cd654 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js @@ -237,6 +237,13 @@ jQuery.validator.addMethod("protocolPort",function(value, element) { var protocolElement=$("[name='"+name.replace("destPort","protocol")+"']"); protocolVal=protocolElement.val(); } + //端口/掩码格式 + if(srcPortVal&&srcPortVal.indexOf("/")>-1){ + srcPortVal=srcPortVal.split("/")[0]; + } + if(destPortVal&&destPortVal.indexOf("/")>-1){ + destPortVal=destPortVal.split("/")[0]; + } if(protocolVal==0){ return true; }else if((protocolVal!=tcp&&protocolVal!=udp&&srcPortVal>0)||(protocolVal!=tcp&&protocolVal!=udp&&destPortVal>0)){ @@ -276,13 +283,13 @@ jQuery.validator.addMethod("ipCheck",function(value, element) { var srcIpIsHidden=srcIpAddressE.is(":hidden"); var destIpIsHidden=destIpAddressE.is(":hidden"); var IPv4RangeDefault="0.0.0.0-0.0.0.0"; - /*if(ipPattern==1){//ip/掩码格式 + if(ipPattern==1){//ip/掩码格式 srcIpAddress=srcIpAddress.indexOf("/") >-1 ?srcIpAddress.split("/")[0] : srcIpAddress; destIpAddress=destIpAddress.indexOf("/") >-1 ?destIpAddress.split("/")[0] : destIpAddress; }else if (ipPattern==2){ srcIpAddress=srcIpAddress.indexOf("-") >-1 ?srcIpAddress.split("-")[0] : srcIpAddress; destIpAddress=destIpAddress.indexOf("-") >-1 ?destIpAddress.split("-")[0] : destIpAddress; - }*/ + } if(srcIpIsHidden){ if((srcIpAddress == destIpAddress)){ $.validator.messages.ipCheck=$.validator.messages.destIpIsNotValue+destIpAddress;