去掉lombok
This commit is contained in:
@ -1,22 +1,21 @@
|
||||
package com.sczx.gateway.filter;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.springframework.cloud.gateway.filter.GlobalFilter;
|
||||
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.server.ServerWebExchange;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class AuthGlobalFilter implements GlobalFilter, Ordered {
|
||||
|
||||
@Override
|
||||
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
|
||||
String path = exchange.getRequest().getPath().value();
|
||||
log.info("🌐 请求路径: {}", path);
|
||||
// log.info("🌐 请求路径: {}", path);
|
||||
|
||||
// 示例:拦截所有请求,校验 token
|
||||
// String token = exchange.getRequest().getHeaders().getFirst("Authorization");
|
||||
|
||||
Reference in New Issue
Block a user