新需求开发
This commit is contained in:
parent
e84c75e99a
commit
430a74a0b8
|
|
@ -19,6 +19,7 @@ import org.springframework.cloud.gateway.filter.GatewayFilterChain;
|
|||
import org.springframework.cloud.gateway.filter.GlobalFilter;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.http.server.reactive.ServerHttpRequest;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.web.server.ServerWebExchange;
|
||||
|
|
@ -38,6 +39,11 @@ public class AuthFilter implements GlobalFilter, Ordered
|
|||
|
||||
public static final String NULL_TOKEN="null";
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.err.println(new BCryptPasswordEncoder().encode("nacos"));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
|
@ -52,6 +58,10 @@ public class AuthFilter implements GlobalFilter, Ordered
|
|||
ServerHttpRequest.Builder mutate = request.mutate();
|
||||
|
||||
String url = request.getURI().getPath();
|
||||
if(url.equals("/auth/sgccLogin")){
|
||||
return chain.filter(exchange);
|
||||
}
|
||||
|
||||
// 跳过不需要验证的路径
|
||||
if (StringUtils.matches(url, ignoreWhite.getWhites()))
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue