getEMKey.js 343 B

12345678910111213141516
  1. /* 用以获取消息存储格式时的key */
  2. const getEMKey = (loginId, fromId, toId, chatType) => {
  3. let key = '';
  4. if (chatType === 'singleChat') {
  5. if (loginId === fromId) {
  6. key = toId;
  7. } else {
  8. key = fromId;
  9. }
  10. } else if (chatType === 'groupChat') {
  11. key = toId;
  12. }
  13. return key;
  14. };
  15. export default getEMKey;