Commit ebf65e40 by Zhang Xin

完善代码

parent 11500a4f
......@@ -412,6 +412,7 @@ class PageContainer extends React.Component {
this.countBackTime = -1;
clearTimeout(this.countbackTimer);
this.countbackTimer = null;
UTILPATH.myLogger.info("endCountBack countBackTime ",this.countBackTime);
}
overTimeSolve(){
......@@ -424,6 +425,7 @@ class PageContainer extends React.Component {
}
countBack(){
UTILPATH.myLogger.info("countBack countBackTime ",this.countBackTime);
if(!this.countbackTimer && this.countBackTime >= 0){
this.countBackTime--;
this.countbackTimer = window.setTimeout(()=>{
......
......@@ -21,6 +21,8 @@ const saveCommonInfo = (newState,data)=>{
};
const emptyCommInfo = (state,data)=>{
UTILPATH.myLogger.info("emptyCommInfo data ",data);
UTILPATH.myLogger.info("emptyCommInfo ",Object.assign({},state,data));
return Object.assign({},state,data)
}
......
import fetch from 'isomorphic-fetch';
let domain = "";
const domainPort = "7788";
const myHeaders = new Headers({
// 'Access-Control-Allow-Origin': '*',
// 'Content-Type': 'text/plain;charset=UTF-8',
......@@ -12,7 +12,7 @@ const myHeaders = new Headers({
const myLogger = {};
myLogger.saveDomain = (ip)=>{
domain = `http://${ip}:7788`;
domain = `http://${ip}:${domainPort}`;
};
myLogger.info = function () {
......@@ -31,8 +31,6 @@ myLogger.info = function () {
.then((json)=>{
}).catch(e=>{
})
}else{
}
};
......@@ -52,8 +50,6 @@ myLogger.error = function () {
.then((json)=>{
}).catch(e=>{
})
}else{
}
};
......
......@@ -3,6 +3,8 @@ import myLogger from './logger'
let domainIp = '192.168.10.';
const domainPort = "7788";
const socket = {};
let totalCount = 0;
......@@ -15,7 +17,7 @@ socket.getIp1 = ()=>{
if(!getIpING) {
getIpING = true;
for(let j = 0; j< 255 ; j ++){
let wsUrl = 'ws://' + domainIp + j + ':7788/notify?from=plant';
let wsUrl = `ws://${domainIp}${j}:${domainPort}/notify?from=plant`;
let ws1 = new WebSocket(wsUrl);
ws1.onopen = function()
{
......@@ -53,7 +55,7 @@ socket.getIp1 = ()=>{
socket.getTestIp = (ip) => {
let wsUrl = 'ws://' + domainIp + ip + ':7788/notify?from=plant';
let wsUrl = `ws://${domainIp}${ip}:${domainPort}/notify?from=plant`;
let ws1 = new WebSocket(wsUrl);
ws1.onopen = function()
{
......@@ -97,7 +99,7 @@ const getClose = ()=>{
const init = (ip,storeid,from = false)=>{
let wsUrl = 'ws://' + domainIp + ip + ':7788/notify?from=plant&storeId=' + storeid;
let wsUrl = `ws://${domainIp}${ip}:${domainPort}/notify?from=plant&storeId=${storeid}`;
if("WebSocket" in window && !ws && ip && storeid && (currentIpIndex === 255 || from)){
ws = new WebSocket(wsUrl);
......
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