From 25980988762a41605eec047ad7e0407b64a757c4 Mon Sep 17 00:00:00 2001 From: ZhangAo Date: Mon, 13 Oct 2025 17:32:02 +0800 Subject: [PATCH] u --- .../src/main/java/com/link/im/ImServer.java | 11 +- .../classes/com/link/im/ImServer$1.class | Bin 2099 -> 2289 bytes .../target/classes/com/link/im/ImServer.class | Bin 4370 -> 4370 bytes code/link/link-frontend/src/App.vue | 12 + .../link-frontend/src/components/icon.vue | 7 +- .../src/stores/websocketStore.js | 100 ++++ .../link/link-frontend/src/views/im/index.vue | 559 ++++++++++++++++-- .../src/pages/im/components/right/index.vue | 2 - 8 files changed, 646 insertions(+), 45 deletions(-) create mode 100644 code/link/link-frontend/src/stores/websocketStore.js 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 cfba2d3b237f0c5553f53b0b65b6e014459ea407..b388fa4f9723bb6c65297ff776fa60c6b573fad5 100644 GIT binary patch delta 876 zcmZ{j%TE(g6vlsdrtQ$7NI|FwMG=dX7HqZhP+syl*=~2`NcIjjNilcj0Vg z;U7UziWrS<-S}U)H^#)cFrEt)OcN)Wd(Y#$-}&a;Gi&~DW!cZaH$MO;nDkObtIdAe ziV4te(P44Y#;yHRbXs(oD6lD_+oH#&m^O=Eo742!^fO>n!l1>FO@cEvWt_DbwyDst zbGERbx42+2qVO!ur4~bRMPPOLu~HYEU+Q_~B_E?)_EAlZkD#`ixZ=Dr#yn#_#<}YJ zFj~zZ*PIqJu9}^nMld|JkXeik$TB>co}Qn{SX}opLDJ%;k6YZq|c!&7@{iX@%AQC^bJllToyX zn?^KaO~IK^9?_{t=zPO}@(T9@&83LtnJNpA!VnK{)hI2;`+*Db3*@e~V=>(d>GUD`~!?EE#!?+Mryy%Dp-E7UnCGIV$tP zU19YyRnUPYqZXu7Ca8;Hx|x#CS*DklGG%pwsN2>+_OI#{8VQSPix)C45fPi$-w6Ie z(I1r)T7N=Px-H&F^do_F_U#t`w<|v35>UP?&0@PG(z3(q*MXzNbVp;vC2w$y<6F3d U{6_U+l}oHjcK!5=@Edsl00#t=egFUf delta 830 zcmah{TW=CU6#j-?nC_M~TLcOsiWL=Tbct=~a9re=RN)kQ8dDsXBrrfl52iUTtLR0FW5!9*VofQyf~zX}Fw2oq2{Eg}gKHeu zRrtiyoJv2;apXB}Fu1IZay=?18T>Y5zMbtNWApZR_B?RYjRh>a5yBBS!a_>m7Q-?7 zz8tXk94XgrH}1f&_Z{O>7)y3sN~YrFs$MZI>#4p`tUTB>Yr0i_WL6uNK1Z5i6)iLO z%fYei#tK#i^j*6p<$DTP6UsgNt7N!N;WRONvE|)ellxdR{IK|>s5h+gre3O6N{w30 ztXTRIVJ}z876Ui3vx^HEgXqow^J$vlWGtW0|L0YFg+VQrN@l$tO(v7}OV@fRNIe0V zriqG>B+(AzC>&Ihejdt2NOy_WU=+vc^pi*QX$Voeg(TwWf0CUHp)CzEC{F=Erf<|T z0ok%2bED}+zoNW`*2aMG4%~s&5&0wJg7g8NLShf>Een0Ebv#oZ~9(#1bR0Ww+69-wN%5ZB4>KoaLV_jv*r<}r-p M1W77I1nH*r6CDML5dZ)H 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 9a89959b17fe3829ca878973ba0b58209572fee3..52370199aa8d47848640bbca9b000c3a6d39bc94 100644 GIT binary patch delta 146 zcmbQFG)Za0eO^ZC$q#tFSTz`g7&JHQ^BFV7>M-yy=rV{i7%<2)7y?;F43-SW3~mf2 z3?U4r3=s^@3~3B541GY6`3yb`iy3?wmNB?9ENAdwSPSHD1oF2qcrt8d@M72r9d?-{k%L3weVW1Q~)Elz`@GF@#Re6$k=4;($O90F_-IkN^Mx delta 146 zcmbQFG)Za0eO^Y%$q#tFSk)MW7}PiG^BFV7YBBIIXfud2=rPDM=riat7%*5e7&5pq z7%_w}7&AmLcrc_fcrx@ccr(mr2xM5y5X7*I!G~cvgD=BcAb%r}zlFh%VJm|_!%iT7 qFOYu#NFN2##~Fer@8@608_pmIG)IXcl0l0hYI3eX5YQ0^1cCscOCQ_- 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;