Commit 22f5ab91 by Zhang Xin

fix bug 2451

parent 2bfa2ae0
......@@ -41,7 +41,7 @@ export default class HomePageContainer extends React.Component{
this.props.willCloseDoor();
let msg={type:'WILL_CLOSEDOOR'};
sendMsg(JSON.stringify(msg))
// this.props.tempLogout()
this.props.tempLogout()
}
showLogoutPopup(){
......
......@@ -205,7 +205,7 @@ class PageContainer extends React.Component {
break;
case 'SUCCESS_CLOSEDOOR':
if(isSend){
this.handleCloseDoor()
// this.handleCloseDoor()
}
break;
......
......@@ -2,7 +2,7 @@ import fetch from 'isomorphic-fetch';
import {emit} from './event'
let domainIp = '192.168.35.';
let domainIp = '192.168.10.';
const socket = {};
......@@ -116,8 +116,17 @@ const init = (ip,storeid,from = false)=>{
ws.onmessage = function (evt)
{
var received_msg = JSON.parse(evt.data); //String
emit(CONFIG.socketType.GETSOCKETMSG,received_msg);
console.log(evt.data);
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)
......
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