From a2ccaae7aa9edfddc81175393ecf484b736cc58d Mon Sep 17 00:00:00 2001 From: tim Date: Fri, 22 Aug 2025 23:01:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=94=B9=E7=94=A8=20patterns=EF=BC=8C?= =?UTF-8?q?=E8=A1=A5=E9=BD=90=20staging=20=E5=9F=9F=E5=90=8D=EF=BC=88https?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/openisle/config/WebSocketConfig.java | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/backend/src/main/java/com/openisle/config/WebSocketConfig.java b/backend/src/main/java/com/openisle/config/WebSocketConfig.java index 6ae1d580c..161cb5963 100644 --- a/backend/src/main/java/com/openisle/config/WebSocketConfig.java +++ b/backend/src/main/java/com/openisle/config/WebSocketConfig.java @@ -44,20 +44,17 @@ public class WebSocketConfig implements WebSocketMessageBrokerConfigurer { registry.addEndpoint("/api/ws") // 安全改进:使用具体的允许源,而不是通配符 .setAllowedOrigins( - "http://127.0.0.1:8080", - "http://127.0.0.1:3000", - "http://127.0.0.1:3001", - "http://127.0.0.1", - "http://localhost:8080", - "http://localhost:3000", - "http://localhost:3001", - "http://localhost", - "http://30.211.97.238:3000", - "http://30.211.97.238", - "http://192.168.7.98", - "http://192.168.7.98:3000", - websiteUrl, - websiteUrl.replace("://www.", "://") + // 本地开发 + "http://localhost:*", + "http://127.0.0.1:*", + "http://192.168.7.98:*", + "http://30.211.97.238:*", + websiteUrl, + websiteUrl.replace("://www.", "://") + + // 线上域名(务必是 https) + "https://staging.open-isle.com", + "https://www.staging.open-isle.com" ) .withSockJS(); }