修复: token过滤器 TokenIgnore 注解在类上指定方法导致整个类接口都忽略问题

This commit is contained in:
ruying408
2024-10-16 23:53:30 +08:00
parent 865499813f
commit 45458ddb6b
4 changed files with 29 additions and 26 deletions
@@ -1,7 +1,6 @@
package com.cool.modules.base.service.sys.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.text.AntPathMatcher;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
@@ -10,6 +9,7 @@ import com.cool.core.config.LogProperties;
import com.cool.core.security.IgnoredUrlsProperties;
import com.cool.core.util.CoolSecurityUtil;
import com.cool.core.util.IPUtils;
import com.cool.core.util.PathUtils;
import com.cool.modules.base.entity.sys.BaseSysLogEntity;
import com.cool.modules.base.entity.sys.BaseSysUserEntity;
import com.cool.modules.base.entity.sys.table.BaseSysLogEntityTableDef;
@@ -43,8 +43,6 @@ public class BaseSysLogServiceImpl extends BaseServiceImpl<BaseSysLogMapper, Bas
private final Executor logTaskExecutor;
private static final AntPathMatcher antPathMatcher = new AntPathMatcher();
@Override
public Object page(
JSONObject requestParams, Page<BaseSysLogEntity> page, QueryWrapper queryWrapper) {
@@ -83,8 +81,7 @@ public class BaseSysLogServiceImpl extends BaseServiceImpl<BaseSysLogMapper, Bas
}
private boolean isIgnoreUrl(String requestURI) {
return ignoredUrlsProperties.getLogUrls().stream()
.anyMatch(url -> antPathMatcher.match(url, requestURI));
return PathUtils.isMatch(ignoredUrlsProperties.getLogUrls(), requestURI);
}
public void recordAsync(String ipAddr, String requestURI, JSONObject requestParams) {