Commit d9dd2bb5 authored by zhouwei's avatar zhouwei

新增未能匹配到token的日志

parent af9e4fac
...@@ -25,6 +25,6 @@ public class ScheduledTasksService { ...@@ -25,6 +25,6 @@ public class ScheduledTasksService {
//定时刷新配置 //定时刷新配置
taskScheduler.scheduleWithFixedDelay(() -> { taskScheduler.scheduleWithFixedDelay(() -> {
refreshConfigSync.autoRefreshConfig(); refreshConfigSync.autoRefreshConfig();
}, 60000); }, 10000);
} }
} }
package com.nanyan.securitylink.service; package com.nanyan.securitylink.service;
import com.alibaba.fastjson.JSONObject;
import com.nanyan.securitylink.config.FailoverProperties; import com.nanyan.securitylink.config.FailoverProperties;
import com.nanyan.securitylink.config.FailoverProperties.UriConfig; import com.nanyan.securitylink.config.FailoverProperties.UriConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.util.AntPathMatcher; import org.springframework.util.AntPathMatcher;
import java.util.Optional; import java.util.Optional;
@Slf4j
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
public class TokenRouteMappingService { public class TokenRouteMappingService {
...@@ -20,6 +23,11 @@ public class TokenRouteMappingService { ...@@ -20,6 +23,11 @@ public class TokenRouteMappingService {
.flatMap(mapping -> mapping.getUriConfigs().stream()) .flatMap(mapping -> mapping.getUriConfigs().stream())
.filter(uriConfig -> pathMatcher.match(uriConfig.getSourceUri(), sourceUri)) .filter(uriConfig -> pathMatcher.match(uriConfig.getSourceUri(), sourceUri))
.findFirst(); .findFirst();
if(first.isPresent()){
log.info("映射的配置:{}", JSONObject.toJSONString(first));
}else {
log.info("token:{} sourceUri:{} 未配置", token, sourceUri);
}
return first; return first;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment