Compare commits

..

2 Commits

Author SHA1 Message Date
LYC f92e5bead8 Merge remote-tracking branch 'origin/master' 2025-04-29 23:06:42 +08:00
LYC cb28d1ae63 [fix] 修改了跨域认证 2025-04-29 21:15:17 +08:00
1 changed files with 3 additions and 1 deletions

View File

@ -84,7 +84,9 @@ public class SecurityConfig {
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
CorsConfiguration config = new CorsConfiguration();
config.setAllowCredentials(true);
config.setAllowedOrigins(Arrays.asList("http://localhost:9527", "http://localhost:8080","http://154.219.110.17:8080", "https://test.tju.edu.kg"));
config.setAllowedOrigins(Arrays.asList("http://localhost:9527", "http://localhost:8080","http://154.219.110.17:8080", "https://test.tju.edu.kg","http://154.219.110.17:8081",
"https://project-frontend.tju.edu.kg","https://project-backend.tju.edu.kg",
"http://project-frontend.tju.edu.kg","http://project-backend.tju.edu.kg"));
config.setAllowedHeaders(Arrays.asList("*"));
config.setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE", "OPTIONS"));
source.registerCorsConfiguration("/**", config);