dev01 1 yıl önce
ebeveyn
işleme
01e7ca9564
1 değiştirilmiş dosya ile 32 ekleme ve 32 silme
  1. 32 32
      src/app.jsx

+ 32 - 32
src/app.jsx

@@ -81,42 +81,42 @@ class App extends Component {
   //   })
   // }
 
-  getStorageSync() {
-    let token = Taro.getStorageSync('token');
-    //建立连接
-    Taro.connectSocket({
-      header: {
-        'token': token,
-      },
-      // 测试
-      // url: 'wss://bm.jishutao.com/webSocketServer',
-      // 本地
-      // url: 'wss://172.16.0.255:8080/webSocketServer'
-      // 生产
-      url: 'wss://uat.jishutao.com/webSocketServer'
-    })
+  // getStorageSync() {
+  //   let token = Taro.getStorageSync('token');
+  //   //建立连接
+  //   Taro.connectSocket({
+  //     header: {
+  //       'token': token,
+  //     },
+  //     // 测试
+  //     // url: 'wss://bm.jishutao.com/webSocketServer',
+  //     // 本地
+  //     // url: 'wss://172.16.0.255:8080/webSocketServer'
+  //     // 生产
+  //     url: 'wss://uat.jishutao.com/webSocketServer'
+  //   })
 
-    //连接成功
-    Taro.onSocketOpen(function () {
-      console.log('连接成功')
-    })
+  //   //连接成功
+  //   Taro.onSocketOpen(function () {
+  //     console.log('连接成功')
+  //   })
 
-    //接收数据
-    Taro.onSocketMessage(function (data) {
-      console.log('接收数据', data)
-      Taro.eventCenter.trigger('GoPuncsshIn', data)
-    })
+  //   //接收数据
+  //   Taro.onSocketMessage(function (data) {
+  //     console.log('接收数据', data)
+  //     Taro.eventCenter.trigger('GoPuncsshIn', data)
+  //   })
 
-    //连接失败
-    Taro.onSocketError(function () {
-      console.log('websocket连接失败!');
-    })
+  //   //连接失败
+  //   Taro.onSocketError(function () {
+  //     console.log('websocket连接失败!');
+  //   })
 
-    //连接关闭
-    Taro.onSocketClose(function () {
-      console.log('websocket连接关闭!');
-    })
-  }
+  //   //连接关闭
+  //   Taro.onSocketClose(function () {
+  //     console.log('websocket连接关闭!');
+  //   })
+  // }
 
   componentDidCatchError() { }