LoginUser
This commit is contained in:
parent
1c5c2471c4
commit
c4c313c691
|
|
@ -3,6 +3,7 @@ package com.bonus.system.api.model;
|
|||
import java.io.Serializable;
|
||||
import java.util.Set;
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
|
|
@ -27,6 +28,7 @@ public class LoginUser implements Serializable
|
|||
/**
|
||||
* 客户id
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||
private Long custId;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
package com.bonus.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.CorsWebFilter;
|
||||
import org.springframework.web.cors.reactive.UrlBasedCorsConfigurationSource;
|
||||
import org.springframework.web.util.pattern.PathPatternParser;
|
||||
|
||||
/**
|
||||
* Description: 全局跨域配置
|
||||
*/
|
||||
@Configuration
|
||||
public class GlobalCorsConfig {
|
||||
@Bean
|
||||
public CorsWebFilter corsFilter() {
|
||||
// 创建一个新的CorsConfiguration对象,用于配置跨域请求
|
||||
CorsConfiguration config = new CorsConfiguration();
|
||||
// 允许所有的HTTP请求方法(GET, POST, PUT, DELETE等)
|
||||
config.addAllowedMethod("*");
|
||||
// 允许所有的域名发起的请求 比如http://localhost:8080、
|
||||
config.addAllowedOrigin("*");
|
||||
// 允许所有的域名发起的请求(支持正则表达式) 比如http://localhost:8080
|
||||
config.addAllowedOriginPattern("*");
|
||||
// 允许所有的请求头部信息 比如token、Content-Type
|
||||
config.addAllowedHeader("*");
|
||||
// 创建一个UrlBasedCorsConfigurationSource对象,并使用PathPatternParser进行路径匹配
|
||||
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(new PathPatternParser());
|
||||
// 注册跨域配置,应用于所有的URL路径
|
||||
source.registerCorsConfiguration("/**", config);
|
||||
return new CorsWebFilter(source);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue