修改 过滤不要需要验证的接口(path)
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
package com.tiesheng.login.config.token;
|
package com.tiesheng.login.config.token;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.util.ObjUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.tiesheng.annotation.token.TokenIgnore;
|
import com.tiesheng.annotation.token.TokenIgnore;
|
||||||
import com.tiesheng.util.ServletKit;
|
import com.tiesheng.util.ServletKit;
|
||||||
@@ -50,14 +52,17 @@ public class TsTokenAspect {
|
|||||||
|
|
||||||
// 过滤不要需要验证的接口(path)
|
// 过滤不要需要验证的接口(path)
|
||||||
String requestURI = ServletKit.getRequest().getRequestURI();
|
String requestURI = ServletKit.getRequest().getRequestURI();
|
||||||
for (String path : tsTokenConfig.getIgnorePaths()) {
|
String[] ignorePaths = tsTokenConfig.getIgnorePaths();
|
||||||
if (path.contains("/**")) {
|
if (ObjUtil.isNotEmpty(ignorePaths)) {
|
||||||
path = path.replace("/**", "");
|
for (String path : ignorePaths) {
|
||||||
if (StrUtil.startWith(requestURI, path)) {
|
if (path.contains("/**")) {
|
||||||
|
path = path.replace("/**", "");
|
||||||
|
if (StrUtil.startWith(requestURI, path)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else if (requestURI.equals(path)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (requestURI.equals(path)) {
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user