浏览代码

:zap: 优化。 对非web 发起的feign 调用进行排除

冷冷 7 年之前
父节点
当前提交
a009ae80de

+ 4 - 0
pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/feign/PigxFeignClientInterceptor.java

@@ -53,6 +53,10 @@ public class PigxFeignClientInterceptor extends OAuth2FeignRequestInterceptor {
 	 */
 	@Override
 	public void apply(RequestTemplate template) {
+		if (template.headers().isEmpty()) {
+			return;
+		}
+
 		if (oAuth2ClientContext != null
 			&& oAuth2ClientContext.getAccessToken() != null) {
 			super.apply(template);