im问题修复

This commit is contained in:
2026-06-02 16:22:05 +08:00
parent a556139b68
commit b475bee7ed

View File

@@ -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()
}