Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

项目是不是缺少跨域支持 #16

Open
ZhanChaoHan opened this issue May 24, 2022 · 0 comments
Open

项目是不是缺少跨域支持 #16

ZhanChaoHan opened this issue May 24, 2022 · 0 comments

Comments

@ZhanChaoHan
Copy link

静态html存在跨域问题,
把跨域解决了吧
@bean
public CorsFilter corsFilter() {
CorsConfiguration config = new CorsConfiguration();
config.addAllowedOrigin("");
config.setAllowCredentials(true);
config.addAllowedMethod("
");
config.addAllowedHeader("*");
UrlBasedCorsConfigurationSource configSource = new UrlBasedCorsConfigurationSource();
configSource.registerCorsConfiguration("/**", config);
return new CorsFilter(configSource);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant