class FrontUserLoginInterceptor extends HandlerInterceptorAdapter {
    @Autowired
    private UserService userService;
    @Autowired
    private UserLoginStatusService userLoginStatusService;

    @Override
    public boolean preHandle(HttpServletRequest request,
            HttpServletResponse response, Object handler) throws Exception {<FILL_FUNCTION_BODY>}
}

        String userName = userLoginStatusService.getUserNameFromLoginStatus(request);
        //未登录
        if (StringUtils.isBlank(userName)) {
            String redirectUrl = userLoginStatusService.getRedirectUrl(request);
            response.sendRedirect(redirectUrl);
            return false;
        }
        AppUser user = userService.getByName(userName);
        //新用户
        if (user == null || user.getType() == -1) {
            String redirectUrl = userLoginStatusService.getRegisterUrl(user);
            response.sendRedirect(redirectUrl);
            return false;
        }
            request.setAttribute("userInfo", user);
        request.setAttribute("uri", request.getRequestURI());

        return true;
    
<methods>public void <init>() ,public void afterCompletion(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object, java.lang.Exception) throws java.lang.Exception,public void afterConcurrentHandlingStarted(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object) throws java.lang.Exception,public void postHandle(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object, org.springframework.web.servlet.ModelAndView) throws java.lang.Exception,public boolean preHandle(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object) throws java.lang.Exception<variables>