gateway
网关模块需要实现的功能流程
断言与过滤器了解,具体功能在配置文件中添加,为锦上添花内容,想要功能改进可以实现
跨域请求
允许所有的请求跨域
方式一: 添加跨域请求配置类
package com.hhf.riceshopping.gateway.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.reactive.CorsConfigurationSource;
import org.springframework.web.cors.reactive.CorsWebFilter;
import org.springframework.web.cors.reactive.UrlBasedCorsConfigurationSource;
import org.springframework.web.server.ServerWebExchange;
@Configuration
public class RiceCorsConfiguration {
@Bean
public CorsWebFilter corsWebFilter(){