From 5ca4929a457c2a9f13f501ce3dc86ba5f308eafa Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Tue, 26 Nov 2024 13:37:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/form/index.ts | 4 ++-- utils/singlr.ts | 16 ---------------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/pages/form/index.ts b/pages/form/index.ts index 9ad8cd8..e6234ba 100644 --- a/pages/form/index.ts +++ b/pages/form/index.ts @@ -23,18 +23,18 @@ Page({ // } // }) - onStop() const that = this; wx.getStorage({ key: 'isConnected', success(res: any) { if (res.data) { - this.setData({ + that.setData({ netWorkErrorDialog: true, }) } }, }) + onStop() wx.getStorage({ key: 'historicalList', success(res: any) { diff --git a/utils/singlr.ts b/utils/singlr.ts index ebe6ef0..473cef6 100644 --- a/utils/singlr.ts +++ b/utils/singlr.ts @@ -13,17 +13,9 @@ export const startSignalr = async (callBack: Function) => { }) .build(); connection.start().then(() => { - wx.setStorage({ - key: "reconnect", - data: true - }) callBack() }) connection.onclose(() => { - wx.setStorage({ - key: "reconnect", - data: false - }) startConnection() }); } @@ -32,10 +24,6 @@ export const startSignalr = async (callBack: Function) => { const routes = getCurrentPages() if (connection.state !== signalR.HubConnectionState.Connected && routes[routes.length - 1].route === 'pages/meeting/index') { connection.start().then(() => { - wx.setStorage({ - key: "reconnect", - data: true - }) }).catch(err => { setTimeout(startConnection, 3000); }); @@ -203,10 +191,6 @@ export const onSignalr = (callBack: Function) => { } } export const onStop = async () => { - wx.setStorage({ - key: "reconnect", - data: false - }) agora.destroy(); if (connection) { connection.stop()