diff --git a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/security/CopyTokenFilter.java b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/security/CopyTokenFilter.java index 96471738ba..e3fa6fd63b 100644 --- a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/security/CopyTokenFilter.java +++ b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/security/CopyTokenFilter.java @@ -26,8 +26,11 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse // 以下为undertow定制代码,如切换其它servlet容器,需要同步更换 HttpServletRequestImpl undertowRequest = (HttpServletRequestImpl) request; String bearerToken = request.getParameter("token"); + String headerBearerToken = request.getHeader("X-Access-Token"); if (StringUtils.hasText(bearerToken)) { undertowRequest.getExchange().getRequestHeaders().add(new HttpString("Authorization"), "bearer " + bearerToken); + } else if (StringUtils.hasText(headerBearerToken)) { + undertowRequest.getExchange().getRequestHeaders().add(new HttpString("Authorization"), "bearer " + headerBearerToken); } filterChain.doFilter(undertowRequest, response); }