|
|
@@ -1,6 +1,7 @@
|
|
|
package com.nb.im.ws.filter;
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.json.JSON;
|
|
|
import cn.hutool.json.JSONObject;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
@@ -55,6 +56,9 @@ public class MsgFormatFilter implements PubMsgFilter {
|
|
|
}else {
|
|
|
key=JSONUtil.parseObj(source.getPayload()).getStr("key");
|
|
|
}
|
|
|
+ if(StrUtil.isBlank(key)){
|
|
|
+ key=source.getKey();
|
|
|
+ }
|
|
|
pubMsgInfo = objectMapper.readerFor(PubMsgInfo.class).readValue(String.valueOf(source.getPayload()));
|
|
|
pubMsgInfo.setKey(key);
|
|
|
pubMsgInfo.validate();
|