diff --git a/src/main/java/cn/wizzer/app/web/commons/ext/handler/WkErrorPageHandler.java b/src/main/java/cn/wizzer/app/web/commons/ext/handler/WkErrorPageHandler.java index e0e7c75d2..0914ebeec 100644 --- a/src/main/java/cn/wizzer/app/web/commons/ext/handler/WkErrorPageHandler.java +++ b/src/main/java/cn/wizzer/app/web/commons/ext/handler/WkErrorPageHandler.java @@ -30,6 +30,7 @@ public void handle(String target, Request baseRequest, HttpServletRequest reques response.getWriter().write(Json.toJson(new NutMap("code", "-1").setv("msg", response.getStatus() + " error"))); return; } else { + request.setAttribute("original_request_uri", request.getRequestURI()); RequestDispatcher rd = request.getRequestDispatcher("/platform/home/" + response.getStatus()); rd.forward(request, response); return; diff --git a/src/main/java/cn/wizzer/app/web/modules/controllers/platform/sys/SysHomeController.java b/src/main/java/cn/wizzer/app/web/modules/controllers/platform/sys/SysHomeController.java index 26e467ec9..2976b171d 100644 --- a/src/main/java/cn/wizzer/app/web/modules/controllers/platform/sys/SysHomeController.java +++ b/src/main/java/cn/wizzer/app/web/modules/controllers/platform/sys/SysHomeController.java @@ -116,8 +116,8 @@ public void path(@Param("url") String url, HttpServletRequest req) { @At("/403") @Ok("re") - public Object error403() { - if (shiroUtil.isAuthenticated()) { + public Object error403(HttpServletRequest req) { + if (Strings.sNull(req.getAttribute("original_request_uri")).startsWith("/platform") && shiroUtil.isAuthenticated()) { return "beetl:/platform/sys/403.html"; } else { return ">>:/error/404.html"; @@ -126,8 +126,8 @@ public Object error403() { @At("/404") @Ok("re") - public Object error404() { - if (shiroUtil.isAuthenticated()) { + public Object error404(HttpServletRequest req) { + if (Strings.sNull(req.getAttribute("original_request_uri")).startsWith("/platform") && shiroUtil.isAuthenticated()) { return "beetl:/platform/sys/404.html"; } else { return ">>:/error/404.html"; @@ -136,8 +136,8 @@ public Object error404() { @At("/500") @Ok("re") - public Object error500() { - if (shiroUtil.isAuthenticated()) { + public Object error500(HttpServletRequest req) { + if (Strings.sNull(req.getAttribute("original_request_uri")).startsWith("/platform") && shiroUtil.isAuthenticated()) { return "beetl:/platform/sys/500.html"; } else { return ">>:/error/500.html";