Commit 7c50c135 by zhoujinghao

jwt修改

1 parent a961ffd9
......@@ -27,16 +27,12 @@
<dependency>
<groupId>org.nafmii</groupId>
<artifactId>nafmii-common</artifactId>
</dependency>
<dependency>
<exclusions><!-- 去掉springboot默认配置 -->
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<!--<exclusions>&lt;!&ndash; 去掉springboot默认配置 &ndash;&gt;-->
<!--<exclusion>-->
<!--<groupId>org.springframework.boot</groupId>-->
<!--<artifactId>spring-boot-starter-logging</artifactId>-->
<!--</exclusion>-->
<!--</exclusions>-->
</exclusion>
</exclusions>
</dependency>
</dependencies>
......
......@@ -33,19 +33,17 @@ public class AccessFilter implements GlobalFilter, Ordered {
@Autowired
private AntPathMatcher antPathMatcher; //路径匹配器
@Override
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
String url = exchange.getRequest().getURI().getPath();
List<String> skipAuthUrls =new ArrayList<>();
//相关不需要的接口地址
skipAuthUrls.add("111111");
String skip ="app/nafmii/**";
//跳过不需要验证的url
for (String skip : skipAuthUrls) {
if (antPathMatcher.match(skip, url)){
return chain.filter(exchange);
}
}
//获取token
String token = exchange.getRequest().getHeaders().getFirst(JwtUtils.TOKEN_HEADER);
if (StringUtils.isBlank(token)){
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!