From 9e75e5de516d3da38a59a11efb6e409d37892ba6 Mon Sep 17 00:00:00 2001 From: Wizzercn Date: Sat, 27 Jul 2019 14:11:21 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E5=B0=86=E5=89=8D=E5=90=8E=E5=8F=B04?= =?UTF-8?q?04/403/505=20=E9=94=99=E8=AF=AF=E9=A1=B5=E4=B8=A5=E6=A0=BC?= =?UTF-8?q?=E5=8C=BA=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/commons/ext/handler/WkErrorPageHandler.java | 1 + .../controllers/platform/sys/SysHomeController.java | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) 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";