Explorar o código

:white_check_mark: fix 会话超时导致框架页出现登录的问题

Aron %!s(int64=6) %!d(string=hai) anos
pai
achega
96244d36f1

+ 2 - 3
src/main/java/com/ifast/common/aspect/DemoModeAspect.java

@@ -51,9 +51,8 @@ public class DemoModeAspect {
                 String[] value = rp.value();
                 List<String> asList = Arrays.asList(value);
                 String string = asList.toString();
-                if (!HttpContextUtils.getHttpServletRequest().getMethod().equalsIgnoreCase("GET")
-                        && (string.contains("remove") || string.contains("Remove") || string.contains("edit")
-                                || string.contains("update") || string.contains("delete"))) {
+                boolean isUpdateOpt = string.contains("remove") || string.contains("Remove") || string.contains("edit") || string.contains("update") || string.contains("delete");
+                if (!HttpContextUtils.getHttpServletRequest().getMethod().equalsIgnoreCase("GET") && isUpdateOpt) {
                     log.error("当前用户未演示账户无权操作!");
                     throw new IFastException(EnumErrorCode.notAuthorization.getCodeStr());
                 }

+ 2 - 1
src/main/java/com/ifast/common/exception/handler/ApplicationExceptionHandler.java

@@ -97,7 +97,8 @@ public class ApplicationExceptionHandler {
 
     @ExceptionHandler(Exception.class)
     public Object handleException(Exception e) {
-        log.error("全局异常处理:Exception[{}]:{}", e.getClass(), e.getMessage());
+        log.info("全局异常处理:Exception[{}]:{}", e.getClass(), e.getMessage());
+        e.printStackTrace();
         if (!HttpContextUtils.isAjax()) {
             ModelAndView mv = new ModelAndView();
             mv.setViewName(ERROR_DEFAULT_PAGE);

+ 4 - 1
src/main/resources/static/css/login/login.js

@@ -287,6 +287,9 @@ $(function(){
 		}
     });
 
-
+	var top = window.top;
+	if(top !== window){
+		window.top.location.href = window.location.href;
+	}
 
 });