From d227481e86a784282464942863a36e76308f21a7 Mon Sep 17 00:00:00 2001 From: Wizzercn Date: Sat, 27 Jul 2019 14:11:44 +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/wk-app/wk-nb-web-vue/src/main/java/cn/wizzer/app/web/commons/ext/handler/WkErrorPageHandler.java b/wk-app/wk-nb-web-vue/src/main/java/cn/wizzer/app/web/commons/ext/handler/WkErrorPageHandler.java index e0e7c75d2..0914ebeec 100644 --- a/wk-app/wk-nb-web-vue/src/main/java/cn/wizzer/app/web/commons/ext/handler/WkErrorPageHandler.java +++ b/wk-app/wk-nb-web-vue/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/wk-app/wk-nb-web-vue/src/main/java/cn/wizzer/app/web/modules/controllers/platform/sys/SysHomeController.java b/wk-app/wk-nb-web-vue/src/main/java/cn/wizzer/app/web/modules/controllers/platform/sys/SysHomeController.java index 5149e9520..2410960d5 100644 --- a/wk-app/wk-nb-web-vue/src/main/java/cn/wizzer/app/web/modules/controllers/platform/sys/SysHomeController.java +++ b/wk-app/wk-nb-web-vue/src/main/java/cn/wizzer/app/web/modules/controllers/platform/sys/SysHomeController.java @@ -118,8 +118,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"; @@ -128,8 +128,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"; @@ -138,8 +138,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";