Commit 22f5ab91 by Zhang Xin

fix bug 2451

parent 2bfa2ae0
...@@ -41,7 +41,7 @@ export default class HomePageContainer extends React.Component{ ...@@ -41,7 +41,7 @@ export default class HomePageContainer extends React.Component{
this.props.willCloseDoor(); this.props.willCloseDoor();
let msg={type:'WILL_CLOSEDOOR'}; let msg={type:'WILL_CLOSEDOOR'};
sendMsg(JSON.stringify(msg)) sendMsg(JSON.stringify(msg))
// this.props.tempLogout() this.props.tempLogout()
} }
showLogoutPopup(){ showLogoutPopup(){
......
...@@ -205,7 +205,7 @@ class PageContainer extends React.Component { ...@@ -205,7 +205,7 @@ class PageContainer extends React.Component {
break; break;
case 'SUCCESS_CLOSEDOOR': case 'SUCCESS_CLOSEDOOR':
if(isSend){ if(isSend){
this.handleCloseDoor() // this.handleCloseDoor()
} }
break; break;
......
...@@ -2,7 +2,7 @@ import fetch from 'isomorphic-fetch'; ...@@ -2,7 +2,7 @@ import fetch from 'isomorphic-fetch';
import {emit} from './event' import {emit} from './event'
let domainIp = '192.168.35.'; let domainIp = '192.168.10.';
const socket = {}; const socket = {};
...@@ -116,8 +116,17 @@ const init = (ip,storeid,from = false)=>{ ...@@ -116,8 +116,17 @@ const init = (ip,storeid,from = false)=>{
ws.onmessage = function (evt) ws.onmessage = function (evt)
{ {
var received_msg = JSON.parse(evt.data); //String console.log(evt.data);
emit(CONFIG.socketType.GETSOCKETMSG,received_msg); if(evt.data === "ping"){
let o = {
type : 'PONG'
}
ws.send(JSON.stringify(o));
}else{
var received_msg = JSON.parse(evt.data); //String
emit(CONFIG.socketType.GETSOCKETMSG,received_msg);
}
}; };
ws.onclose = function(err) ws.onclose = function(err)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment