@onyx-p/imlib-web 2.3.1 → 2.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js CHANGED
@@ -21017,7 +21017,7 @@ class MessageCache {
21017
21017
  currentAppKey = '';
21018
21018
  currentUserId = '';
21019
21019
  APP_INFO_KEY = 'im_app_info';
21020
- DB_NAME_PREFIX = 'im_message_cache_new';
21020
+ DB_NAME_PREFIX = 'im_message_cache_1';
21021
21021
  DB_VERSION = 2;
21022
21022
  STORE_NAME = 'messages_new';
21023
21023
  DIALOG_STATE_STORE = 'dialogStates_new';
@@ -21189,7 +21189,7 @@ class MessageCache {
21189
21189
  if (!content) return '';
21190
21190
  try {
21191
21191
  const contentStr = JSON.stringify(content);
21192
- return contentStr;
21192
+ return aes256Encrypt(contentStr, this.encryptKey);
21193
21193
  } catch (error) {
21194
21194
  logger.error('加密消息内容失败', error);
21195
21195
  return '';
@@ -21200,7 +21200,7 @@ class MessageCache {
21200
21200
  return null;
21201
21201
  }
21202
21202
  try {
21203
- const decryptedStr = encryptedHex;
21203
+ const decryptedStr = aes256Decrypt(encryptedHex, this.encryptKey);
21204
21204
  return JSON.parse(decryptedStr);
21205
21205
  } catch (error) {
21206
21206
  logger.error('解密消息内容失败', error);
package/index.umd.js CHANGED
@@ -21023,7 +21023,7 @@
21023
21023
  currentAppKey = '';
21024
21024
  currentUserId = '';
21025
21025
  APP_INFO_KEY = 'im_app_info';
21026
- DB_NAME_PREFIX = 'im_message_cache_new';
21026
+ DB_NAME_PREFIX = 'im_message_cache_1';
21027
21027
  DB_VERSION = 2;
21028
21028
  STORE_NAME = 'messages_new';
21029
21029
  DIALOG_STATE_STORE = 'dialogStates_new';
@@ -21195,7 +21195,7 @@
21195
21195
  if (!content) return '';
21196
21196
  try {
21197
21197
  const contentStr = JSON.stringify(content);
21198
- return contentStr;
21198
+ return aes256Encrypt(contentStr, this.encryptKey);
21199
21199
  } catch (error) {
21200
21200
  logger.error('加密消息内容失败', error);
21201
21201
  return '';
@@ -21206,7 +21206,7 @@
21206
21206
  return null;
21207
21207
  }
21208
21208
  try {
21209
- const decryptedStr = encryptedHex;
21209
+ const decryptedStr = aes256Decrypt(encryptedHex, this.encryptKey);
21210
21210
  return JSON.parse(decryptedStr);
21211
21211
  } catch (error) {
21212
21212
  logger.error('解密消息内容失败', error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onyx-p/imlib-web",
3
- "version": "2.3.1",
3
+ "version": "2.3.3",
4
4
  "main": "index.umd.js",
5
5
  "module": "index.esm.js",
6
6
  "types": "types/index.d.ts",