Merge pull request #2459 from dataease/pr@dev@fix_font_timeout_notnull

fix: 前端超时时间非空判断
This commit is contained in:
fit2cloud-chenyw 2022-06-21 11:19:59 +08:00 committed by GitHub
commit c3c642612c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
}