package cn.palmte.work.config.interceptor;

import cn.palmte.work.config.log.LogExcluder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 打印header中的token，有助于排查问题
 * @author xiongshiyan
 */
@Component
public class TokenLoggingInterceptor extends AbstractLoginInterceptor {
    @Autowired
    private LogExcluder logExcluder;
    /**
     * 在Handler执行之前处理
     */
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
            throws Exception {
        printNeccery(request , logExcluder);
        return true;
    }
}