Skip to content

Commit

Permalink
feat:优化代码
Browse files Browse the repository at this point in the history
  • Loading branch information
gzydong committed Jun 26, 2022
1 parent c2d14ab commit e8af21e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/plugins/ws-socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,11 @@ class WsSocket {
let t = new Date().getTime()

if (t - this.lastTime > this.config.heartbeat.pingTimeout) {
this.connect.close()

if(this.connect){
this.connect.close()
}

this.reconnect()
} else {
this.ping()
Expand Down

0 comments on commit e8af21e

Please sign in to comment.