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,12 +68,13 @@ public class SystemParameterController {
|
|||||||
@RequiresPermissions("sysparam:read")
|
@RequiresPermissions("sysparam:read")
|
||||||
@PostMapping("/edit/basic")
|
@PostMapping("/edit/basic")
|
||||||
public CasSaveResult editBasic(@RequestBody List<SystemParameter> systemParameter) {
|
public CasSaveResult editBasic(@RequestBody List<SystemParameter> systemParameter) {
|
||||||
int timeout = Integer.parseInt(systemParameter.stream().filter(
|
String value = systemParameter.stream().filter(parameter -> parameter.getParamKey().equals("basic.frontTimeOut")).findFirst().get().getParamValue();
|
||||||
parameter -> parameter.getParamKey().equals("basic.frontTimeOut")
|
if (StringUtils.isNotBlank(value)) {
|
||||||
).findFirst().get().getParamValue());
|
int timeout = Integer.parseInt(value);
|
||||||
if (timeout < 0 || timeout > 300) { //增加了合法性检验
|
if (timeout < 0 || timeout > 300) { //增加了合法性检验
|
||||||
throw new NumberFormatException("Timeout Range Error!");
|
throw new NumberFormatException("Timeout Range Error!");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return systemParameterService.editBasic(systemParameter);
|
return systemParameterService.editBasic(systemParameter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user