//package com.tuoheng.common.core.interceptor;
//
//import com.tuoheng.common.core.constant.SecurityHeadConstant;
//import feign.RequestInterceptor;
//import feign.RequestTemplate;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.context.request.RequestContextHolder;
//import org.springframework.web.context.request.ServletRequestAttributes;
//
//import javax.servlet.http.HttpServletRequest;
//
///**
// * @Author: 吴彬
// * @CreateTime: 2022-09-19  08:57
// * @Description: gateway feign请求全局添加用户加密json-token
// * @Version: 1.0
// */
//@Configuration
//public class FeignRequestInterceptor implements RequestInterceptor {
//
//    @Override
//    public void apply(RequestTemplate requestTemplate) {
//        HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
//        requestTemplate.header(SecurityHeadConstant.JSON_TOKEN, request.getHeader(SecurityHeadConstant.JSON_TOKEN));
//    }
//}
