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