src/main/java/cn/org/xinke/annotation/LoginAspect.java
@@ -31,7 +31,7 @@ // 登录认证 User loginUser = (User) request.getSession().getAttribute( "LOGIN_USER" ); if (loginUser == null) { response.sendRedirect( "/login.html" ); response.sendRedirect( loadContextPath(request) + "/login.html" ); } try { return pjp.proceed(); @@ -39,4 +39,12 @@ throw throwable; } } public String loadContextPath(HttpServletRequest request) { String contextPath = request.getContextPath(); if(contextPath.equals("/")) { contextPath = ""; } return contextPath; } }