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