FeignConfig去掉白名单

This commit is contained in:
liuh
2022-03-02 09:57:36 +08:00
parent fe8c89e961
commit 23a6989e58

View File

@ -12,6 +12,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpRange;
import org.springframework.http.HttpRequest;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
@ -64,10 +66,10 @@ public class FeignConfig implements RequestInterceptor {
template.header(CURRENT_ROLE_CODE, currentRoleCode);
}
} else if (isExistsWhiteList(template.url(), template.method())) {
String access_token = getAccessToken();
log.info("token=======access_token===" + access_token);
template.header(HttpHeaders.AUTHORIZATION, String.format("%s%s", TOKEN_PREFIX, access_token));
} {
String accessToken = getAccessToken();
log.info("token=======accessToken===" + accessToken);
template.header(HttpHeaders.AUTHORIZATION, String.format("%s%s", TOKEN_PREFIX, accessToken));
}
}