定义一组路径llist
/**
* 放行的路径
*/
List<String> EXCLUDE_PATHS = Arrays.asList(
"/qw/login",
"/qw/callback",
"/message-send/sap-notice",
"/digital-auth/sign-job-callback",
"/digital-auth/id-face-callback",
"/sync/id-face-config",
"/id-face-record"
);
/**
* 放行的路径
*/
List<String> EXCLUDE_PATHS = Arrays.asList(
"/qw/login",
"/qw/callback",
"/message-send/sap-notice",
"/digital-auth/sign-job-callback",
"/digital-auth/id-face-callback",
"/sync/id-face-config",
"/id-face-record"
);
进行路径匹配
/**
* 判断请求路径是否需要跳过
* @param request
* @return
*/
private boolean shouldSkip(HttpServletRequest request) {
String path = request.getRequestURI();
return CommonConstant.EXCLUDE_PATHS.stream().anyMatch(pattern -> {
AntPathMatcher matcher = new AntPathMatcher();
return matcher.match(pattern, path);
});
}
/**
* 判断请求路径是否需要跳过
* @param request
* @return
*/
private boolean shouldSkip(HttpServletRequest request) {
String path = request.getRequestURI();
return CommonConstant.EXCLUDE_PATHS.stream().anyMatch(pattern -> {
AntPathMatcher matcher = new AntPathMatcher();
return matcher.match(pattern, path);
});
}

1万+

被折叠的 条评论
为什么被折叠?



