Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Commit

Permalink
fix: 修复主动关闭socket仍然alert弹窗
Browse files Browse the repository at this point in the history
  • Loading branch information
leirensheng committed Dec 15, 2020
1 parent 669ed2a commit e0bdb2c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/controllers/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,10 @@ const server = {

//连接关闭时触发
_this.websocket.onclose = function(){
console.info(locale().websocket.close);

alert(locale().websocket.contact);
console.info(locale().websocket.close);
if(e.code!==1000){
alert(locale().websocket.contact);
}
}
}
else{
Expand Down
3 changes: 1 addition & 2 deletions src/global/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -6291,8 +6291,7 @@ export function closeWebsocket(){
if(server.websocket == null){
return;
}

server.websocket.close();
server.websocket.close(1000);
}


Expand Down

0 comments on commit e0bdb2c

Please sign in to comment.