forked from github/dataease
Merge pull request #2459 from dataease/pr@dev@fix_font_timeout_notnull
fix: 前端超时时间非空判断
This commit is contained in:
commit
c3c642612c
@ -68,11 +68,12 @@ public class SystemParameterController {
|
||||
@RequiresPermissions("sysparam:read")
|
||||
@PostMapping("/edit/basic")
|
||||
public CasSaveResult editBasic(@RequestBody List<SystemParameter> systemParameter) {
|
||||
int timeout = Integer.parseInt(systemParameter.stream().filter(
|
||||
parameter -> parameter.getParamKey().equals("basic.frontTimeOut")
|
||||
).findFirst().get().getParamValue());
|
||||
if (timeout < 0 || timeout > 300) { //增加了合法性检验
|
||||
throw new NumberFormatException("Timeout Range Error!");
|
||||
String value = systemParameter.stream().filter(parameter -> parameter.getParamKey().equals("basic.frontTimeOut")).findFirst().get().getParamValue();
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
int timeout = Integer.parseInt(value);
|
||||
if (timeout < 0 || timeout > 300) { //增加了合法性检验
|
||||
throw new NumberFormatException("Timeout Range Error!");
|
||||
}
|
||||
}
|
||||
return systemParameterService.editBasic(systemParameter);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user