fix: 改用 patterns,补齐 staging 域名(https)

This commit is contained in:
tim
2025-08-22 23:01:57 +08:00
parent 23371d4433
commit a2ccaae7aa

View File

@@ -44,20 +44,17 @@ public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
registry.addEndpoint("/api/ws") registry.addEndpoint("/api/ws")
// 安全改进:使用具体的允许源,而不是通配符 // 安全改进:使用具体的允许源,而不是通配符
.setAllowedOrigins( .setAllowedOrigins(
"http://127.0.0.1:8080", // 本地开发
"http://127.0.0.1:3000", "http://localhost:*",
"http://127.0.0.1:3001", "http://127.0.0.1:*",
"http://127.0.0.1", "http://192.168.7.98:*",
"http://localhost:8080", "http://30.211.97.238:*",
"http://localhost:3000", websiteUrl,
"http://localhost:3001", websiteUrl.replace("://www.", "://")
"http://localhost",
"http://30.211.97.238:3000", // 线上域名(务必是 https
"http://30.211.97.238", "https://staging.open-isle.com",
"http://192.168.7.98", "https://www.staging.open-isle.com"
"http://192.168.7.98:3000",
websiteUrl,
websiteUrl.replace("://www.", "://")
) )
.withSockJS(); .withSockJS();
} }