去掉lombok

This commit is contained in:
2025-07-05 13:17:46 +08:00
parent 6c585048a7
commit e77df34556
2 changed files with 10 additions and 13 deletions

16
pom.xml
View File

@ -84,12 +84,12 @@
<!-- Lombok --> <!-- Lombok -->
<dependency> <!-- <dependency>-->
<groupId>org.projectlombok</groupId> <!-- <groupId>org.projectlombok</groupId>-->
<artifactId>lombok</artifactId> <!-- <artifactId>lombok</artifactId>-->
<version>1.18.24</version> <!-- <version>1.18.24</version>-->
<scope>provided</scope> <!-- <scope>provided</scope>-->
</dependency> <!-- </dependency>-->
<!-- Swagger 文档 --> <!-- Swagger 文档 -->
<dependency> <dependency>
@ -122,13 +122,11 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration> <configuration>
<!-- 强制使用 Java 8 模式编译 --> <!-- 强制使用 Java 8 模式编译 -->
<release>8</release> <!-- <release>8</release>-->
<source>${java.version}</source> <source>${java.version}</source>
<target>${java.version}</target> <target>${java.version}</target>
<fork>true</fork>
</configuration> </configuration>
</plugin> </plugin>

View File

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