优化业务校验失败普通请求跳转页面
parent
cd3dbd775b
commit
d1b440fc0d
|
@ -17,7 +17,5 @@
|
|||
<a href="javascript:top.document.location.href='/'" class="btn btn-primary m-t">主页</a>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/js/jquery.min.js?v=2.1.4"></script>
|
||||
<script src="/js/bootstrap.min.js?v=3.3.6"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -18,7 +18,5 @@
|
|||
<a href="javascript:top.document.location.href='/'" class="btn btn-primary m-t">主页</a>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/js/jquery.min.js?v=2.1.4"></script>
|
||||
<script src="/js/bootstrap.min.js?v=3.3.6"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>RuoYi - 403</title>
|
||||
<link href="/css/bootstrap.min.css" rel="stylesheet"/>
|
||||
<link href="/css/animate.css" rel="stylesheet"/>
|
||||
<link href="/css/style.css" rel="stylesheet"/>
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="middle-box text-center animated fadeInDown">
|
||||
<h3 class="font-bold">操作异常!</h3>
|
||||
|
||||
<div class="error-desc">
|
||||
[[${errorMessage}]]
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -18,7 +18,5 @@
|
|||
<a href="javascript:top.document.location.href='/'" class="btn btn-outline btn-primary btn-xs">返回主页</a>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/js/jquery.min.js?v=2.1.4"></script>
|
||||
<script src="/js/bootstrap.min.js?v=3.3.6"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -77,10 +77,21 @@ public class GlobalExceptionHandler
|
|||
* 业务异常
|
||||
*/
|
||||
@ExceptionHandler(BusinessException.class)
|
||||
public AjaxResult businessException(BusinessException e)
|
||||
public Object businessException(HttpServletRequest request, BusinessException e)
|
||||
{
|
||||
log.error(e.getMessage(), e);
|
||||
return AjaxResult.error(e.getMessage());
|
||||
|
||||
if (ServletUtils.isAjaxRequest(request))
|
||||
{
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
else
|
||||
{
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.addObject("errorMessage", e.getMessage());
|
||||
modelAndView.setViewName("error/business");
|
||||
return modelAndView;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue