Browse Source

socket 优化

xiaohaizhao 2 years ago
parent
commit
bcc01fdaed
2 changed files with 4 additions and 2 deletions
  1. 3 1
      pages/index/userCenter/index.js
  2. 1 1
      pages/login/modules/login.js

+ 3 - 1
pages/index/userCenter/index.js

@@ -70,8 +70,10 @@ Component({
 			})
 			downCount = setTimeout(() => {
 				_Http.logout().then(res => {
+					getApp().globalData.SocketTask.close()
 					wx.showToast({
-						title: '退出成功'
+						title: '退出成功',
+						mask:true
 					});
 					let loginMsg = wx.getStorageSync("loginMsg");
 					wx.clearStorageSync();

+ 1 - 1
pages/login/modules/login.js

@@ -74,7 +74,7 @@ function toHome() {
     wx.reLaunch({
         url: '/pages/index/index'
     })
-    if (!getApp().globalData.socketEstablish) getApp().initSocket();
+    getApp().initSocket();
 }
 /* 站点数据查询 */
 module.exports = {