|
@@ -65,7 +65,10 @@ public class BimUserInfoPreFilter extends ZuulFilter {
|
|
public Object run() throws ZuulException {
|
|
public Object run() throws ZuulException {
|
|
RequestContext ctx = RequestContext.getCurrentContext();
|
|
RequestContext ctx = RequestContext.getCurrentContext();
|
|
HttpServletRequest request = ctx.getRequest();
|
|
HttpServletRequest request = ctx.getRequest();
|
|
- if (isNeedUserInfo(request)) {
|
|
|
|
|
|
+ String contextPath = serverProperties.getServlet().getContextPath();
|
|
|
|
+ String requestUri = request.getRequestURI();
|
|
|
|
+
|
|
|
|
+ if (isNeedUserInfo(contextPath, requestUri)) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -108,12 +111,12 @@ public class BimUserInfoPreFilter extends ZuulFilter {
|
|
/**
|
|
/**
|
|
* 是否需要用户信息
|
|
* 是否需要用户信息
|
|
*
|
|
*
|
|
- * @param request 请求
|
|
|
|
|
|
+ * @param contextPath 上下文
|
|
|
|
+ * @param requestUri 请求路径
|
|
* @return 是否需要
|
|
* @return 是否需要
|
|
*/
|
|
*/
|
|
- private boolean isNeedUserInfo(HttpServletRequest request) {
|
|
|
|
- String contextPath = serverProperties.getServlet().getContextPath();
|
|
|
|
- String requestUri = request.getRequestURI();
|
|
|
|
|
|
+ public boolean isNeedUserInfo(String contextPath, String requestUri) {
|
|
|
|
+
|
|
logger.debug("Security filter origin uri:{}", requestUri);
|
|
logger.debug("Security filter origin uri:{}", requestUri);
|
|
|
|
|
|
// 去除上下文
|
|
// 去除上下文
|