修改配置异常提示信息

This commit is contained in:
zhanghongqing
2018-11-05 15:43:12 +08:00
parent a11f637e6b
commit 97eb005a6d
41 changed files with 256 additions and 142 deletions

View File

@@ -62,11 +62,15 @@ public class DdosCfgController extends BaseController {
@ModelAttribute("cfg")DdosIpCfg cfg, RedirectAttributes redirectAttributes){
try{
ddosCfgService.saveOrUpdate(cfg);
addMessage(redirectAttributes,"save_success");
addMessage(redirectAttributes,"success","save_success");
}catch(Exception e){
logger.error("信息保存失败",e);
e.printStackTrace();
addMessage(redirectAttributes,"save_failed");
if(e instanceof MaatConvertException) {
addMessage(redirectAttributes,"error",e.getMessage());
}else {
addMessage(redirectAttributes,"error","save_failed");
}
}
return "redirect:" + adminPath +"/manipulation/ddos/list?functionId="+cfg.getFunctionId();