ratelimit验证使用字典
This commit is contained in:
@@ -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<SysDataDictionaryItem> 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) {
|
||||
|
||||
Reference in New Issue
Block a user