修正配置controller的消息重定向后无法传至前台的问题,使用model的模式改为redirectAttributes模式

This commit is contained in:
zhangwei
2018-07-02 09:45:04 +08:00
parent ad3ccdc0a2
commit 01eebad6c1
5 changed files with 19 additions and 26 deletions

View File

@@ -137,14 +137,14 @@ public class HttpRedirectPolicyController extends BaseController{
@RequestMapping(value = {"saveOrUpdate"})
@RequiresPermissions(value={"control:httpRedirect:config"})
public String saveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response,
@ModelAttribute("cfg")CfgIndexInfo cfg){
@ModelAttribute("cfg")CfgIndexInfo cfg,RedirectAttributes redirectAttributes){
try{
httpRedirectCfgService.saveHttpCfg(cfg);
addMessage(model,"save_success");
addMessage(redirectAttributes,"save_success");
}catch(Exception e){
logger.error("信息保存失败",e);
e.printStackTrace();
addMessage(model,"save_failed");
addMessage(redirectAttributes,"save_failed");
}
return "redirect:" + adminPath +"/proxy/control/httpRedirect/list?functionId="+cfg.getFunctionId();