From d1b6a13a58afa4e03f4d6cb0a62cd759ccf306f4 Mon Sep 17 00:00:00 2001 From: ageerle <ageerle@163.com> Date: 星期二, 04 三月 2025 10:06:00 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/main' --- ruoyi-common/ruoyi-common-chat/src/main/java/org/ruoyi/common/chat/config/WebSocketConfig.java | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ruoyi-common/ruoyi-common-chat/src/main/java/org/ruoyi/common/chat/config/WebSocketConfig.java b/ruoyi-common/ruoyi-common-chat/src/main/java/org/ruoyi/common/chat/config/WebSocketConfig.java index 7b09004..f9242c6 100644 --- a/ruoyi-common/ruoyi-common-chat/src/main/java/org/ruoyi/common/chat/config/WebSocketConfig.java +++ b/ruoyi-common/ruoyi-common-chat/src/main/java/org/ruoyi/common/chat/config/WebSocketConfig.java @@ -29,15 +29,17 @@ public WebSocketConfigurer webSocketConfigurer(HandshakeInterceptor handshakeInterceptor, WebSocketHandler webSocketHandler, WebSocketProperties webSocketProperties) { + // 濡傛灉WebSocket鐨勮矾寰勪负绌猴紝鍒欒缃粯璁よ矾寰勪负 "/websocket" if (StrUtil.isBlank(webSocketProperties.getPath())) { webSocketProperties.setPath("/websocket"); } - + // 濡傛灉鍏佽璺ㄥ煙璁块棶鐨勫湴鍧�涓虹┖锛屽垯璁剧疆涓� "*"锛岃〃绀哄厑璁告墍鏈夋潵婧愮殑璺ㄥ煙璇锋眰 if (StrUtil.isBlank(webSocketProperties.getAllowedOrigins())) { webSocketProperties.setAllowedOrigins("*"); } - + // 杩斿洖涓�涓猈ebSocketConfigurer瀵硅薄锛岀敤浜庨厤缃甒ebSocket return registry -> registry + // 娣诲姞WebSocket澶勭悊绋嬪簭鍜屾嫤鎴櫒鍒版寚瀹氳矾寰勶紝璁剧疆鍏佽鐨勮法鍩熸潵婧� .addHandler(webSocketHandler, webSocketProperties.getPath()) .addInterceptors(handshakeInterceptor) .setAllowedOrigins(webSocketProperties.getAllowedOrigins()); -- Gitblit v1.9.3