From a4b16f40439917639067dca0351712398612c906 Mon Sep 17 00:00:00 2001 From: wangxin Date: Mon, 6 Aug 2018 15:09:12 +0800 Subject: [PATCH] =?UTF-8?q?(1)=E4=BF=AE=E5=A4=8D=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=97=B6=E9=A1=B5=E9=9D=A2=E8=A2=AB=E9=81=AE=E7=9B=96=E5=B1=82?= =?UTF-8?q?=E8=A6=86=E7=9B=96=E7=9A=84bug=20(2)APP=E7=AD=96=E7=95=A5?= =?UTF-8?q?=EF=BC=8C=E5=9F=BA=E7=A1=80=E5=8D=8F=E8=AE=AE=EF=BC=8C=E5=8A=A0?= =?UTF-8?q?=E5=AF=86=E9=9A=A7=E9=81=93=E8=A1=8C=E4=B8=BA=E8=B0=83=E6=95=B4?= =?UTF-8?q?=EF=BC=8C=E8=87=AA=E5=AE=9A=E4=B9=89=E5=9F=9F=E6=81=A2=E5=A4=8D?= =?UTF-8?q?=EF=BC=9B=E5=88=86=E9=9A=94=EF=BC=8C=E5=85=B3=E9=94=AE=E5=AD=97?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E7=94=A8&=E8=BF=9E=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/nis/util/Constants.java | 1 + .../service/configuration/AppCfgService.java | 48 ++++++++++++------- src/main/resources/nis.properties | 5 +- src/main/webapp/WEB-INF/tags/sys/delRow.tag | 4 +- 4 files changed, 38 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/nis/util/Constants.java b/src/main/java/com/nis/util/Constants.java index aa9a253a4..fb251f988 100644 --- a/src/main/java/com/nis/util/Constants.java +++ b/src/main/java/com/nis/util/Constants.java @@ -432,6 +432,7 @@ public final class Constants { public static final Integer CLIENT_READ_TIMEOUT = Configurations.getIntProperty("client_read_timeout",1000); public static final Integer CLIENT_SOCKET_TIMEOUT = Configurations.getIntProperty("client_socket_timeout",1000); public static final String APP_ID_REGION = Configurations.getStringProperty("app_id_region","APP_ID"); + public static final String PROTO_ID_REGION = Configurations.getStringProperty("proto_id_region","APP_ID"); public static final String BEHAV_ID_REGION = Configurations.getStringProperty("behav_id_region","BEHAV_ID"); public static final String RATE_LIMIT_REGION = Configurations.getStringProperty("rate_limit_region","RATE_LIMIT"); public static final String AREA_REGION = Configurations.getStringProperty("area_region","area_ip"); diff --git a/src/main/java/com/nis/web/service/configuration/AppCfgService.java b/src/main/java/com/nis/web/service/configuration/AppCfgService.java index eef85a512..2294b341a 100644 --- a/src/main/java/com/nis/web/service/configuration/AppCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AppCfgService.java @@ -413,11 +413,25 @@ public class AppCfgService extends BaseService { entity.setTableName(AppPolicyCfg.getTablename()); appCfgDao.auditCfg(entity); if(isAudit==1){ + StringBuffer cfgKeywords=new StringBuffer(); if(entity.getBehavCode()!=null){ - entity.setCfgKeywords(entity.getAppCode()+Constants.KEYWORD_EXPR+entity.getBehavCode()); + if(Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equalsIgnoreCase(configType)) { + cfgKeywords.append(Constants.APP_ID_REGION+"="+entity.getAppCode()); + }else if(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR.equalsIgnoreCase(configType)||Constants.SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL.equalsIgnoreCase(configType)) { + cfgKeywords.append(Constants.PROTO_ID_REGION+"="+entity.getAppCode()); + } + cfgKeywords.append(Constants.KEYWORD_EXPR); + cfgKeywords.append(Constants.BEHAV_ID_REGION+"="+entity.getBehavCode()); +// entity.setCfgKeywords(entity.getAppCode()+Constants.KEYWORD_EXPR+entity.getBehavCode()); }else{ - entity.setCfgKeywords(entity.getAppCode()+""); + if(Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equalsIgnoreCase(configType)) { + cfgKeywords.append(Constants.APP_ID_REGION+"="+entity.getAppCode()); + }else if(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR.equalsIgnoreCase(configType)||Constants.SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL.equalsIgnoreCase(configType)) { + cfgKeywords.append(Constants.PROTO_ID_REGION+"="+entity.getAppCode()); + } +// entity.setCfgKeywords(entity.getAppCode()+""); } + entity.setCfgKeywords(cfgKeywords.toString()); List list = new ArrayList(); list.add(entity); Map map = cfgConvert(strRegionList,list,2,entity,groupRelationList); @@ -469,30 +483,30 @@ public class AppCfgService extends BaseService { maatCfg.setGroupNum(groupRelationList.size()); maatCfg.setAreaIpRegionList(areaIpRegionList); maatCfg.setIsValid(entity.getIsValid()); + String userRegion=null; if(Constants.SPECIFIC_SERVICE_CFG_TYPE_APP.equalsIgnoreCase(configType)) { //设置APP自定义域 - String userRegion = Constants.APP_ID_REGION+"="+entity.getAppCode(); - //限速业务需要设置 - String actionCode = DictUtils.getDictCode("SERVICE_ACTION", "action_ratelimit"); - if(!actionCode.equals("默认")){ - if(entity.getAction().equals(Integer.parseInt(actionCode))){ - userRegion += Constants.APP_CFG_USERREGION_SPLITOR+Constants.RATE_LIMIT_REGION+"="+entity.getRatelimit(); - } - } + userRegion = Constants.APP_ID_REGION+"="+entity.getAppCode(); if(entity.getBehavCode()!=null) { - userRegion += Constants.APP_CFG_USERREGION_SPLITOR+Constants.BEHAV_ID_REGION+"="+entity.getBehavCode(); + userRegion += Constants.USER_REGION_SPLIT+Constants.BEHAV_ID_REGION+"="+entity.getBehavCode(); } - maatCfg.setUserRegion(userRegion); }else if(Constants.SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL.equalsIgnoreCase(configType)) { - String userRegion = Constants.APP_ID_REGION+"="+entity.getAppCode(); - maatCfg.setUserRegion(userRegion); + userRegion = Constants.PROTO_ID_REGION+"="+entity.getAppCode(); }else if(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR.equalsIgnoreCase(configType)) { - String userRegion = Constants.APP_ID_REGION+"="+entity.getAppCode(); + userRegion = Constants.PROTO_ID_REGION+"="+entity.getAppCode(); if(entity.getBehavCode()!=null) { - userRegion += Constants.APP_CFG_USERREGION_SPLITOR+Constants.BEHAV_ID_REGION+"="+entity.getBehavCode(); + userRegion += Constants.USER_REGION_SPLIT+Constants.BEHAV_ID_REGION+"="+entity.getBehavCode(); } - maatCfg.setUserRegion(userRegion); + } + //限速业务需要设置 + String actionCode = DictUtils.getDictCode("SERVICE_ACTION", "action_ratelimit"); + if(!actionCode.equals("默认")){ + if(entity.getAction().equals(Integer.parseInt(actionCode))){ + userRegion += Constants.USER_REGION_SPLIT+Constants.RATE_LIMIT_REGION+"="+entity.getRatelimit(); + } + } + maatCfg.setUserRegion(userRegion); configCompileList.add(maatCfg); maatBean.setConfigCompileList(configCompileList); maatBean.setAuditTime(entity.getAuditTime()); diff --git a/src/main/resources/nis.properties b/src/main/resources/nis.properties index 4ea1f0477..d8430cd8d 100644 --- a/src/main/resources/nis.properties +++ b/src/main/resources/nis.properties @@ -431,7 +431,7 @@ specific_service_cfg_type_app=social_app specific_service_cfg_type_encrypted_tunnel_behavior=encrypted_tunnel_behavior specific_service_cfg_type_basic_protocol=basic_protocol #基础协议自定义域 -app_id_region=APP_ID +proto_id_region=PROTO_ID #IP默认值 ipv4_default_ip_value=\:\: ipv4_default_ip_subnet_value=0.0.0.0/32 @@ -447,4 +447,5 @@ maat_cfg_dolog_doblacklist_default=1 maat_cfg_dolog_configpercent_default=100 maat_cfg_dolog_configoption_default=1 #app,基础协议,特定服务的userregion分隔符 -app_cfg_userregion_splitor=& \ No newline at end of file +app_cfg_userregion_splitor=& +app_id_region=APP_ID \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/tags/sys/delRow.tag b/src/main/webapp/WEB-INF/tags/sys/delRow.tag index 32dbda3c5..9c152c94d 100644 --- a/src/main/webapp/WEB-INF/tags/sys/delRow.tag +++ b/src/main/webapp/WEB-INF/tags/sys/delRow.tag @@ -172,7 +172,9 @@ var checkboxes=$("#${id} ${value} tbody tr td input.i-checks:checkbox"); }else{ window.location = url+"?ids="+ids+"&compileIds="+compileIds; } - loading(''); + if(url.indexOf("?isAudit") > 1){ + loading(''); + } //$("#searchForm").submit(); } },{buttonsFocus:1});