增加即时消息内容AES加密
This commit is contained in:
parent
025388cc86
commit
27d586a9bb
@ -50,7 +50,7 @@ public class WebSocketTextHandler {
|
||||
MessageSendStatusBody messageSendStatusBody = null;
|
||||
try {
|
||||
if (webSocketProperties.getEncrypt()) {
|
||||
String decodeMessage = AesUtil.aesCommonDecoder(WebSocketChannelManager.MESSAGE_AES_KEY, textWebSocketFrame.text());
|
||||
String decodeMessage = AesUtil.aesCommonDecoder(webSocketProperties.getAesKey(), textWebSocketFrame.text());
|
||||
clientSocketMessage = JSONObject.parseObject(decodeMessage, WebSocketClientMessage.class);
|
||||
} else {
|
||||
clientSocketMessage = JSONObject.parseObject(textWebSocketFrame.text(), WebSocketClientMessage.class);
|
||||
|
@ -158,7 +158,7 @@ public class WebSocketChannelManager implements IWebSocketChannelManager {
|
||||
}
|
||||
String message;
|
||||
if (webSocketProperties.getEncrypt()) {
|
||||
message = AesUtil.aesCommonEncoder(MESSAGE_AES_KEY, JSONObject.toJSONString(webSocketClientMessage));
|
||||
message = AesUtil.aesCommonEncoder(webSocketProperties.getAesKey(), JSONObject.toJSONString(webSocketClientMessage));
|
||||
} else {
|
||||
message = JSONObject.toJSONString(webSocketClientMessage);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user