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 : {})