Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
libai
/
guodong
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
8e79daa9
authored
Mar 11, 2021
by
libai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试
parent
a8229bd5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
21 deletions
gzh/customer/guodong.html
gzh/customer/guodong.html
View file @
8e79daa9
...
...
@@ -506,7 +506,7 @@
function WebSocketStart(guestid,send) {
clearInterval(timmer)
state("连接中");
if(ws!=null&&ws.readyState == WebSocket.OPEN){
system("The socket is opening,please close first!");
...
...
@@ -524,7 +524,7 @@
}
ws.onopen = function()
{
recOk=true;
state("连接成功");
system("客服已接入");
if(send){
...
...
@@ -549,13 +549,9 @@
$("#guestid").val('
'
);
tips
(
"连接已断开"
,
"error"
,
3000
);
if
(
recOk
){
var
recNum
=
0
timmer
=
setInterval
(
function
(){
var
guestid
=
$
(
"#guestid"
).
val
();
WebSocketStart
(
guestid
,
false
)
recNum
++
if
(
recNum
>=
5
)
clearInterval
(
timmer
)
},
3000
);
var
guestid
=
$
(
"#guestid"
).
val
();
WebSocketStart
(
guestid
,
false
)
recOk
=
false
;
}
console
.
error
(
"WebSocket close observed:"
,
event
);
...
...
@@ -563,18 +559,11 @@
ws
.
onerror
=
function
(
event
)
{
// 关闭 websocket
var
guestid
=
$
(
"#guestid"
).
val
();
WebSocketStart
(
guestid
,
false
)
// if(recOk){
// var recNum=0
// timmer=setInterval(function(){
// recNum++
// if(recNum>=5)clearInterval(timmer)
// }, 3000);
// }
if
(
recOk
){
var
guestid
=
$
(
"#guestid"
).
val
();
WebSocketStart
(
guestid
,
false
)
recOk
=
false
;
}
state
(
"连接错误"
);
msgbulid
(
1
,
"会话意外断开,发送消息即可联系客服"
,
"系统"
,
1
);
console
.
error
(
"WebSocket error observed:"
,
event
);
...
...
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