@@ -0,0 +1,1260 @@
+package com.lance.freemaker.interceptor;%0A%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0A%0Aimport org.springframework.web.servlet.HandlerInterceptor;%0Aimport org.springframework.web.servlet.ModelAndView;%0A%0Aimport com.lance.freemaker.domain.UserInfo;%0A%0Apublic class AdminInterceptor implements HandlerInterceptor %7B%0A%0A%09@Override%0A%09public boolean preHandle(HttpServletRequest request, HttpServletResponse response,%0A%09        Object handler) throws Exception %7B%0A%09%09Object obj = request.getSession().getAttribute(%22sys_user_key%22);%0A%09%09String xrequest = request.getHeader(%22x-requested-with%22);%09%09%0A%0A%09%09if (obj == null %7C%7C !(obj instanceof UserInfo)) %7B%0A%09%09%09if(%22XMLHttpRequest%22.equalsIgnoreCase(xrequest)) %7B//%E6%8B%A6%E6%88%AAAJAX%E8%AF%B7%E6%B1%82%0A%09%09%09%09response.setHeader(%22sessionstatus%22, %22timeout%22);%0A%09%09%09%7Delse %7B%0A%09%09%09%09 response.sendRedirect(request.getContextPath() + %22/system/login%22);%0A%09%09%09%7D%0A%09%09%09%0A%09%09%09return false;%0A        %7D%0A%09%09return true;%0A%09%7D%0A%0A%09@Override%0A%09public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,%0A%09        ModelAndView modelAndView) throws Exception %7B%0A%09%09%0A%09%7D%0A%0A%09@Override%0A%09public void afterCompletion(HttpServletRequest request, HttpServletResponse response,%0A%09        Object handler, Exception ex) throws Exception %7B%0A%0A%09%7D%0A%7D

add resource