From 1b90b7c10fcc02e092007fe5b31ad111f0c4e4cd Mon Sep 17 00:00:00 2001 From: dgflash Date: Mon, 29 Aug 2022 15:21:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9C=AC=E5=9C=B0=E5=AD=98?= =?UTF-8?q?=E5=82=A8=E5=AF=B9=E8=B1=A1=E4=BC=A0=E9=80=92=E5=B8=83=E5=B0=94?= =?UTF-8?q?=E5=80=BC=E4=BC=9A=E8=A7=A6=E5=8F=91catch=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/core/common/storage/StorageManager.ts | 6 ++++-- assets/libs/network/protocol/pako.min.js.meta | 5 ++--- assets/libs/security/crypto-js.js.meta | 3 ++- assets/libs/security/jsencrypt.min.js.meta | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/assets/core/common/storage/StorageManager.ts b/assets/core/common/storage/StorageManager.ts index 85e4236..c54863e 100644 --- a/assets/core/common/storage/StorageManager.ts +++ b/assets/core/common/storage/StorageManager.ts @@ -3,6 +3,7 @@ import { PREVIEW } from "cc/env"; import { md5 } from "../../../libs/security/Md5"; import { EncryptUtil } from "./EncryptUtil"; +/** 本地存储 */ export module storage { let _key: string | null = null; let _iv: string | null = null; @@ -63,9 +64,10 @@ export module storage { else if (typeof value === 'number') { value = value + ""; } + if (!PREVIEW && null != _key && null != _iv) { try { - value = EncryptUtil.aesEncrypt(value, _key, _iv); + value = EncryptUtil.aesEncrypt(`${value}`, _key, _iv); } catch (e) { value = null; @@ -99,8 +101,8 @@ export module storage { catch (e) { str = null; } - } + if (null == defaultValue || typeof defaultValue === 'string') { return str; } diff --git a/assets/libs/network/protocol/pako.min.js.meta b/assets/libs/network/protocol/pako.min.js.meta index c7ca914..e76c75a 100644 --- a/assets/libs/network/protocol/pako.min.js.meta +++ b/assets/libs/network/protocol/pako.min.js.meta @@ -10,8 +10,7 @@ "userData": { "isPlugin": true, "loadPluginInWeb": true, - "loadPluginInNative": true, - "loadPluginInEditor": false, - "dependencies": [] + "loadPluginInNative": false, + "loadPluginInEditor": false } } diff --git a/assets/libs/security/crypto-js.js.meta b/assets/libs/security/crypto-js.js.meta index 8a267db..9bf2c00 100644 --- a/assets/libs/security/crypto-js.js.meta +++ b/assets/libs/security/crypto-js.js.meta @@ -10,6 +10,7 @@ "userData": { "isPlugin": true, "loadPluginInWeb": true, - "loadPluginInNative": true + "loadPluginInNative": false, + "executionScope": "global" } } diff --git a/assets/libs/security/jsencrypt.min.js.meta b/assets/libs/security/jsencrypt.min.js.meta index c206979..7a26db7 100644 --- a/assets/libs/security/jsencrypt.min.js.meta +++ b/assets/libs/security/jsencrypt.min.js.meta @@ -11,6 +11,6 @@ "dependencies": [], "isPlugin": true, "loadPluginInWeb": true, - "loadPluginInNative": true + "loadPluginInNative": false } }