From bfb80faaf51fd1e48b83bede86c5c0617312c8cf Mon Sep 17 00:00:00 2001 From: ch Date: Thu, 9 Jun 2022 12:24:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9SDK?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/msb-im.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/utils/msb-im.js b/src/utils/msb-im.js index d743eba..7cf7d89 100644 --- a/src/utils/msb-im.js +++ b/src/utils/msb-im.js @@ -2,7 +2,7 @@ * @Author: ch * @Date: 2022-05-18 14:54:47 * @LastEditors: ch - * @LastEditTime: 2022-06-09 11:50:54 + * @LastEditTime: 2022-06-09 12:23:24 * @Description: file content */ import '@/utils/poto-req'; @@ -85,7 +85,13 @@ class MsbIm { console.log('[im] close'); this.interceptors.onClose && this.interceptors.onClose(); }; - if (uni) { + let isUni = false; + try { + isUni = uni; + } catch (e) { + isUni = false; + } + if (isUni) { this.socket = uni.connectSocket({ ...this.option, fail(e) { @@ -138,7 +144,14 @@ class MsbIm { }; const par = fromatPotoReq(data.traceId, data.traceType, data.content); - if (uni) { + + let isUni = false; + try { + isUni = uni; + } catch (e) { + isUni = false; + } + if (isUni) { this.socket.send({ data: par, fail(e) {