From 1a027b6ec1c3cf96e7c5113e0d08049e88968bef Mon Sep 17 00:00:00 2001 From: WindowBird <13870814+windows-bird@user.noreply.gitee.com> Date: Wed, 8 Oct 2025 10:16:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=93=9D=E7=89=99=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/blueToothTest/item2.vue | 880 +++++++++++++++++++++++++ app/components/blufi/crypto/aes.js | 17 +- 2 files changed, 893 insertions(+), 4 deletions(-) diff --git a/app/components/blueToothTest/item2.vue b/app/components/blueToothTest/item2.vue index 27324a8..ad68919 100644 --- a/app/components/blueToothTest/item2.vue +++ b/app/components/blueToothTest/item2.vue @@ -1,11 +1,891 @@ \ No newline at end of file diff --git a/app/components/blufi/crypto/aes.js b/app/components/blufi/crypto/aes.js index 03d90a3..c30a6ce 100644 --- a/app/components/blufi/crypto/aes.js +++ b/app/components/blufi/crypto/aes.js @@ -1157,9 +1157,18 @@ } else if (typeof define === 'function' && define.amd) { define(aesjs) } else { - if (root.aesjs) { - aesjs._aesjs = root.aesjs + // 修复Web环境中的this上下文问题 + const globalThis = (function() { + if (typeof globalThis !== 'undefined') return globalThis + if (typeof self !== 'undefined') return self + if (typeof window !== 'undefined') return window + if (typeof global !== 'undefined') return global + return {} + })() + + if (globalThis.aesjs) { + aesjs._aesjs = globalThis.aesjs } - root.aesjs = aesjs + globalThis.aesjs = aesjs } -})(this) +})(typeof globalThis !== 'undefined' ? globalThis : typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : {})