Browse Source

bug修改

yuantianjiao 6 years ago
parent
commit
bd26273605
2 changed files with 12 additions and 6 deletions
  1. 1
    1
      dist/index.html
  2. 11
    5
      src/pages/system/newOrder/newOrderList/index.vue

+ 1
- 1
dist/index.html View File

@@ -1 +1 @@
1
-<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel=stylesheet href=//at.alicdn.com/t/font_775069_dwqa9wy3lkh.css><link rel="shortcut icon" href=favorite.ico><title>城的空间后台管理系统</title><link href=./static/css/app.bf70b42de6cff066f179f6fcb263c589.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.7e921535e20f729cf046.js></script><script type=text/javascript src=./static/js/app.71e24e76faf4dd36b9f1.js></script></body></html>
1
+<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel=stylesheet href=//at.alicdn.com/t/font_775069_dwqa9wy3lkh.css><link rel="shortcut icon" href=favorite.ico><title>城的空间后台管理系统</title><link href=./static/css/app.3701d2ecdb620da25b5f579564321337.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.7e921535e20f729cf046.js></script><script type=text/javascript src=./static/js/app.4cecf8ef134122787596.js></script></body></html>

+ 11
- 5
src/pages/system/newOrder/newOrderList/index.vue View File

@@ -142,9 +142,7 @@ export default {
142 142
     console.log(this.websockets)
143 143
     this.needReload = false
144 144
     Object.keys(this.websockets).forEach((key) => {
145
-      console.log(key, this.websockets[key])
146
-      this.websockets[key].close()
147
-      clearInterval(this.websockets[key].interval)
145
+      this.destroyWebsocket(this.websockets[key])
148 146
     })
149 147
     this.websockets = {}
150 148
     next()
@@ -153,8 +151,7 @@ export default {
153 151
     init () {
154 152
       this.needReload = false
155 153
       Object.keys(this.websockets).forEach((key) => {
156
-        console.log(key, this.websockets[key])
157
-        this.websockets[key].close()
154
+        this.destroyWebsocket(this.websockets[key])
158 155
       })
159 156
       this.websockets = {}
160 157
       this.needReload = true
@@ -311,6 +308,7 @@ export default {
311 308
     },
312 309
     newWebsocket (wsRealPath) {
313 310
       const ws = this.websockets[wsRealPath]
311
+      console.log('newWebsocket', ws)
314 312
       if (!ws) {
315 313
         const url = `${window.location.origin.replace('http', 'ws')}${wsRealPath}?token=${localStorage.getItem('JWT')}`
316 314
         this.websockets[wsRealPath] = new WebSocket(url)
@@ -338,6 +336,14 @@ export default {
338 336
         }, 5000)
339 337
       }
340 338
     },
339
+    destroyWebsocket (ws) {
340
+      ws.onclose = ((ws) => {
341
+        console.log('close')
342
+      })(ws)
343
+      ws.close()
344
+      clearInterval(ws.interval)
345
+      ws = null
346
+    },
341 347
     open () {
342 348
       if (!this.CaseId) {
343 349
         this.$message({