2
0

fix: 修复菜单和feign问题

This commit is contained in:
caiyuchao
2025-02-18 20:31:48 +08:00
parent f89e1da57e
commit c502a2b303
3 changed files with 7 additions and 9 deletions

View File

@@ -40,10 +40,11 @@ public class FeignRequestInterceptor implements RequestInterceptor {
String authentication = headers.get(SecurityConstants.AUTHORIZATION_HEADER);
if (StringUtils.isNotEmpty(authentication)) {
Collection<String> headerValues = requestTemplate.headers().get(SecurityConstants.AUTHORIZATION_HEADER);
boolean hasToken = headerValues.stream().anyMatch(c -> c.startsWith(SecurityConstants.PRE_ACCESS_TOKEN));
boolean hasToken = headerValues != null && headerValues.stream().anyMatch(c -> c.startsWith(SecurityConstants.PRE_ACCESS_TOKEN));
if (!hasToken) {
requestTemplate.header(SecurityConstants.AUTHORIZATION_HEADER, authentication);
}
}
String language = headers.get(SecurityConstants.CONTENT_LANGUAGE);
if (StringUtils.isNotEmpty(language)) {