diff --git a/code/link/link-backend/src/main/java/com/link/im/ImServer.java b/code/link/link-backend/src/main/java/com/link/im/ImServer.java index bd9aede3..c4e6aed7 100644 --- a/code/link/link-backend/src/main/java/com/link/im/ImServer.java +++ b/code/link/link-backend/src/main/java/com/link/im/ImServer.java @@ -8,6 +8,8 @@ import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.nio.NioServerSocketChannel; import io.netty.handler.codec.http.HttpObjectAggregator; import io.netty.handler.codec.http.HttpServerCodec; +import io.netty.handler.codec.http.cors.CorsConfig; +import io.netty.handler.codec.http.cors.CorsHandler; import io.netty.handler.stream.ChunkedWriteHandler; import io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler; import io.netty.handler.timeout.IdleStateHandler; @@ -53,18 +55,11 @@ public class ImServer { protected void initChannel(SocketChannel ch) { ChannelPipeline pipeline = ch.pipeline(); - // ===== HTTP 协议支持 ===== pipeline.addLast(new HttpServerCodec()); pipeline.addLast(new HttpObjectAggregator(65536)); pipeline.addLast(new ChunkedWriteHandler()); - - // ===== 心跳检测 ===== - pipeline.addLast(new IdleStateHandler(60, 0, 0, TimeUnit.SECONDS)); - - // ===== WebSocket 协议支持 ===== + pipeline.addLast(new CorsHandler(CorsConfig.withAnyOrigin().build())); pipeline.addLast(new WebSocketServerProtocolHandler(websocketPath, null, true, 65536)); - - // ===== 自定义消息处理 ===== pipeline.addLast(new ImWebSocketHandler()); } }); diff --git a/code/link/link-backend/target/classes/com/link/im/ImServer$1.class b/code/link/link-backend/target/classes/com/link/im/ImServer$1.class index cfba2d3b..b388fa4f 100644 Binary files a/code/link/link-backend/target/classes/com/link/im/ImServer$1.class and b/code/link/link-backend/target/classes/com/link/im/ImServer$1.class differ diff --git a/code/link/link-backend/target/classes/com/link/im/ImServer.class b/code/link/link-backend/target/classes/com/link/im/ImServer.class index 9a89959b..52370199 100644 Binary files a/code/link/link-backend/target/classes/com/link/im/ImServer.class and b/code/link/link-backend/target/classes/com/link/im/ImServer.class differ diff --git a/code/link/link-frontend/src/App.vue b/code/link/link-frontend/src/App.vue index c97b1623..b3b4000e 100644 --- a/code/link/link-frontend/src/App.vue +++ b/code/link/link-frontend/src/App.vue @@ -1,4 +1,16 @@ - diff --git a/code/sllog/Sllog-User-Ui/src/pages/im/components/right/index.vue b/code/sllog/Sllog-User-Ui/src/pages/im/components/right/index.vue index cabf0ef4..90598e3c 100644 --- a/code/sllog/Sllog-User-Ui/src/pages/im/components/right/index.vue +++ b/code/sllog/Sllog-User-Ui/src/pages/im/components/right/index.vue @@ -490,7 +490,6 @@ function getRollbackContent(data: GetHistoryResult) { } .chat-center-item-left { display: flex; - align-items: flex-start; width: fit-content; max-width: 70%; flex-direction: row; @@ -498,7 +497,6 @@ function getRollbackContent(data: GetHistoryResult) { } .chat-center-item-right { display: flex; - align-items: flex-start; width: fit-content; max-width: 70%; flex-direction: row-reverse;