|
@@ -83,8 +83,8 @@ public class TokenFilter implements GlobalFilter, Ordered {
|
|
|
String path = request.getURI().getPath();
|
|
|
log.info("当前路径为" + path + ",判断是否为忽略路径.");
|
|
|
// 查询是否是忽略路径
|
|
|
- boolean pass = decideIgnore(path);
|
|
|
- if (pass) {
|
|
|
+ boolean ignore = decideIgnore(path);
|
|
|
+ if (ignore) {
|
|
|
// 忽略路径直接放行
|
|
|
log.info("当前路径为" + path + ",是忽略过滤路径,直接放行!");
|
|
|
return chain.filter(exchange);
|
|
@@ -126,7 +126,7 @@ public class TokenFilter implements GlobalFilter, Ordered {
|
|
|
List<String> permissions = permissionMap.get(loginType);
|
|
|
Boolean isPermission = true;
|
|
|
for (String permission : permissions) {
|
|
|
- if(path.startsWith(permission)){
|
|
|
+ if(path.contains(permission)){
|
|
|
isPermission = true;
|
|
|
break;
|
|
|
}
|
|
@@ -159,7 +159,7 @@ public class TokenFilter implements GlobalFilter, Ordered {
|
|
|
private boolean decideIgnore(String servletPath) {
|
|
|
//跳过不需要验证的路径
|
|
|
for (String ignore : ignoreAuthUrls) {
|
|
|
- if (servletPath.startsWith(ignore)) {
|
|
|
+ if (servletPath.contains(ignore)) {
|
|
|
return true;
|
|
|
}
|
|
|
}
|