From 370142a99ff00fc0a6f7f13d046eed9b9dd5ffe7 Mon Sep 17 00:00:00 2001 From: wangyu <823267011@qq.com> Date: Tue, 2 Jun 2026 17:25:45 +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, 4 insertions(+), 1 deletion(-) diff --git a/ruoyi-ui/src/utils/imClient.js b/ruoyi-ui/src/utils/imClient.js index cf9ba08..947ad00 100644 --- a/ruoyi-ui/src/utils/imClient.js +++ b/ruoyi-ui/src/utils/imClient.js @@ -29,7 +29,10 @@ class ImClient { if (typeof window !== 'undefined' && typeof window.commonEventFunc !== 'function') { window.commonEventFunc = function () {} } - this.sdk = getSDK({ coreWasmPath: '/openIM.wasm', debug: false }) + // 用 BASE_URL 拼路径,部署到子目录时也能正确解析;线上 nginx 必须给 .wasm 配 application/wasm MIME + const base = (typeof process !== 'undefined' && process.env && process.env.BASE_URL) || '/' + const wasmUrl = base.replace(/\/?$/, '/') + 'openIM.wasm' + this.sdk = getSDK({ coreWasmPath: wasmUrl, debug: false }) this._wireEvents() }