全局鉴权
This commit is contained in:
parent
64a73af6de
commit
f825294e79
|
@ -2,9 +2,11 @@ package ocean.gateway.service;
|
|||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
||||
|
||||
@SpringBootApplication(scanBasePackages = {"ocean.gateway.service.*"})
|
||||
@ComponentScan
|
||||
public class ServiceApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ServiceApplication.class, args);
|
||||
|
|
28
src/main/java/ocean/gateway/service/filters/TokenFilter.java
Normal file
28
src/main/java/ocean/gateway/service/filters/TokenFilter.java
Normal file
|
@ -0,0 +1,28 @@
|
|||
package ocean.gateway.service.filters;
|
||||
|
||||
import org.springframework.boot.SpringBootConfiguration;
|
||||
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
|
||||
import org.springframework.cloud.gateway.filter.GlobalFilter;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.server.ServerWebExchange;
|
||||
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
|
||||
@Component
|
||||
@Order(0)
|
||||
public class TokenFilter implements GlobalFilter {
|
||||
|
||||
public TokenFilter() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -7,8 +7,9 @@ import org.springframework.context.annotation.Bean;
|
|||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
|
||||
@SpringBootConfiguration
|
||||
@Slf4j
|
||||
public class Business {
|
||||
@Bean
|
||||
public RouteLocator customRouteLocator(RouteLocatorBuilder builder) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user