|
|
|
@ -35,11 +35,7 @@ public class JeecgFeignService implements IJeecgFeignService {
|
|
|
|
|
.encoder(encoder)
|
|
|
|
|
.decoder(decoder)
|
|
|
|
|
.contract(contract);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <T> T newInstance(Class<T> clientClass, String serviceName) {
|
|
|
|
|
builder.requestInterceptor(requestTemplate -> {
|
|
|
|
|
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
|
|
|
|
if (null != attributes) {
|
|
|
|
@ -54,6 +50,11 @@ public class JeecgFeignService implements IJeecgFeignService {
|
|
|
|
|
requestTemplate.header(CommonConstant.X_ACCESS_TOKEN, token);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public <T> T newInstance(Class<T> clientClass, String serviceName) {
|
|
|
|
|
return builder.target(clientClass, String.format("http://%s/", serviceName));
|
|
|
|
|
}
|
|
|
|
|
}
|