From 12720ad2a8ac36e59501d8d135ffdaa43a6b9590 Mon Sep 17 00:00:00 2001 From: wangxin Date: Mon, 22 Oct 2018 20:02:59 +0800 Subject: [PATCH] =?UTF-8?q?ratelimit=E9=AA=8C=E8=AF=81=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E5=AD=97=E5=85=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/nis/web/controller/BaseController.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/nis/web/controller/BaseController.java b/src/main/java/com/nis/web/controller/BaseController.java index 2194ee230..ec21da70b 100644 --- a/src/main/java/com/nis/web/controller/BaseController.java +++ b/src/main/java/com/nis/web/controller/BaseController.java @@ -1097,8 +1097,16 @@ public class BaseController { if(serviceDict.getFunctionId().intValue()==5&&serviceDict.getAction().intValue()==64) { String userRegion1=baseIpCfg.getUserRegion1(); try { - Double ratelimt= Double.parseDouble(userRegion1); - if(ratelimt>0.009||ratelimt<0.001) { +// Double ratelimt= Double.parseDouble(userRegion1); + List ratelimtList=DictUtils.getDictList("RATE_LIMIT"); + boolean has=false; + for(SysDataDictionaryItem ratelimit:ratelimtList) { + if(ratelimit.getItemCode().equals(userRegion1)) { + has=true; + break; + } + } + if(!has) { errInfo.append(prop.getProperty("ratelimit")+"."+String.format(prop.getProperty("must_between"),0.001,0.009)+";"); } } catch (Exception e) {