| | |
| | | */ |
| | | @Override |
| | | public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) { |
| | | //开发环境不校验 |
| | | if (SpringContextUtil.checkDev()){ |
| | | return chain.filter(exchange); |
| | | }else { |
| | | String url = exchange.getRequest().getURI().getPath(); |
| | | //跳过不需要验证的路径 |
| | | List<String> skipAuthUrlList = Arrays.asList(skipAuthUrls); |
| | |
| | | exchange.getRequest().mutate().header("Authorization-userId", userId).build(); |
| | | ServerWebExchange mutableExchange = exchange.mutate().request(mutableReq).build(); |
| | | return chain.filter(mutableExchange); |
| | | } |
| | | } |
| | | } |
| | | } |