提交 86fb2a00 编写于 作者: zhouweidong's avatar zhouweidong

bug fixed

上级 9efbe64f
...@@ -16,7 +16,6 @@ package ${pub.getPKGCodeName()}.util.web; ...@@ -16,7 +16,6 @@ package ${pub.getPKGCodeName()}.util.web;
import feign.RequestInterceptor; import feign.RequestInterceptor;
import feign.RequestTemplate; import feign.RequestTemplate;
import net.ibizsys.sample.mng.util.client.IBZUAAFeignClient;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -27,7 +26,6 @@ import org.springframework.util.MultiValueMap; ...@@ -27,7 +26,6 @@ import org.springframework.util.MultiValueMap;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
...@@ -43,7 +41,7 @@ public class FeignRequestInterceptor implements RequestInterceptor { ...@@ -43,7 +41,7 @@ public class FeignRequestInterceptor implements RequestInterceptor {
<#if oauth2Enable> <#if oauth2Enable>
@Autowired @Autowired
IBZUAAFeignClient ibzuaaFeignClient; ${pub.getPKGCodeName()}.util.client.IBZUAAFeignClient uaaFeignClient;
@Value("${r'${ibiz.oauth2.grantType:client_credentials}'}") @Value("${r'${ibiz.oauth2.grantType:client_credentials}'}")
private String grantType; private String grantType;
...@@ -84,7 +82,7 @@ public class FeignRequestInterceptor implements RequestInterceptor { ...@@ -84,7 +82,7 @@ public class FeignRequestInterceptor implements RequestInterceptor {
postParameters.add("client_id", clientId); postParameters.add("client_id", clientId);
postParameters.add("client_secret", clientSecret); postParameters.add("client_secret", clientSecret);
postParameters.add("grant_type", grantType); postParameters.add("grant_type", grantType);
LinkedHashMap<String,String> token = (LinkedHashMap<String, String>)ibzuaaFeignClient.getToken(postParameters); LinkedHashMap<String,String> token = (LinkedHashMap<String, String>)uaaFeignClient.getToken(postParameters);
if(!ObjectUtils.isEmpty(token.get("access_token"))){ if(!ObjectUtils.isEmpty(token.get("access_token"))){
requestTemplate.header(oauth2Authorization, "Bearer "+token.get("access_token")); requestTemplate.header(oauth2Authorization, "Bearer "+token.get("access_token"));
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册