mirror of
https://gitee.com/log4j/pig.git
synced 2024-12-22 12:48:58 +08:00
🐛 Fixing a bug. close #I5Q2AB 导入excel接口,在该接口service层通过remoteOrganizationService.getOrgList(SecurityConstants.FROM)携带token方式访问其他接口报错超时
This commit is contained in:
parent
9a30f95aac
commit
8c4543e3e0
@ -14,7 +14,6 @@ import org.springframework.security.oauth2.server.resource.web.BearerTokenResolv
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Collection;
|
||||
import java.util.Enumeration;
|
||||
|
||||
/**
|
||||
* oauth2 feign token传递
|
||||
@ -51,22 +50,13 @@ public class PigOAuthRequestInterceptor implements RequestInterceptor {
|
||||
return;
|
||||
}
|
||||
HttpServletRequest request = WebUtils.getRequest().get();
|
||||
Enumeration<String> headerNames = request.getHeaderNames();
|
||||
if (headerNames != null) {
|
||||
while (headerNames.hasMoreElements()) {
|
||||
String name = headerNames.nextElement();
|
||||
String values = request.getHeader(name);
|
||||
template.header(name, values);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 避免请求参数的 query token 无法传递
|
||||
String token = tokenResolver.resolve(request);
|
||||
if (StrUtil.isBlank(token)) {
|
||||
return;
|
||||
}
|
||||
template.header(HttpHeaders.AUTHORIZATION, String.format("%s %s", OAuth2AccessToken.TokenType.BEARER, token));
|
||||
template.header(HttpHeaders.AUTHORIZATION,
|
||||
String.format("%s %s", OAuth2AccessToken.TokenType.BEARER.getValue(), token));
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user