From b475bee7ed3059fd529d9637a6d2625119a948bf Mon Sep 17 00:00:00 2001 From: wangyu <823267011@qq.com> Date: Tue, 2 Jun 2026 16:22:05 +0800 Subject: [PATCH] =?UTF-8?q?im=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/utils/imClient.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ruoyi-ui/src/utils/imClient.js b/ruoyi-ui/src/utils/imClient.js index 65715be..cf9ba08 100644 --- a/ruoyi-ui/src/utils/imClient.js +++ b/ruoyi-ui/src/utils/imClient.js @@ -24,6 +24,11 @@ class ImClient { if (this.loginPromise) return this.loginPromise if (!this.sdk) { + // 兜底:某些时机下 wasm 会先调 window.commonEventFunc 再被 SDK 覆盖, + // 提前挂一个空 stub 避免 "window.commonEventFunc is not a function" + if (typeof window !== 'undefined' && typeof window.commonEventFunc !== 'function') { + window.commonEventFunc = function () {} + } this.sdk = getSDK({ coreWasmPath: '/openIM.wasm', debug: false }) this._wireEvents() }