Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
max_android_panel
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Zhang Xin
max_android_panel
Commits
ebf65e40
Commit
ebf65e40
authored
Apr 08, 2019
by
Zhang Xin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善代码
parent
11500a4f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
9 deletions
+11
-9
client/containers/PageContainer/PageContainer.jsx
+2
-0
client/reducers/common.js
+2
-0
client/util/logger.js
+2
-6
client/util/socket.js
+5
-3
No files found.
client/containers/PageContainer/PageContainer.jsx
View file @
ebf65e40
...
...
@@ -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
(()
=>
{
...
...
client/reducers/common.js
View file @
ebf65e40
...
...
@@ -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
)
}
...
...
client/util/logger.js
View file @
ebf65e40
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
{
}
};
...
...
client/util/socket.js
View file @
ebf65e40
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment