mirror of
https://github.com/chatopera/cosin.git
synced 2025-08-01 16:38:02 +08:00
#117 优化坐席端socket连接
This commit is contained in:
parent
030ab101e8
commit
46de46407e
@ -2,7 +2,7 @@ var socketCallout;
|
|||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
var protocol = window.location.protocol.replace(/:/g,'');
|
var protocol = window.location.protocol.replace(/:/g,'');
|
||||||
socketCallout = io.connect(protocol + '://' + hostname + ':' + port + '/callout/exchange?orgi=' + orgi + "&userid=" + userid + "&session=" + session + "&admin=" + adminuser);
|
socketCallout = io(protocol + '://' + hostname + ':' + port + '/callout/exchange?orgi=' + orgi + "&userid=" + userid + "&session=" + session + "&admin=" + adminuser, {transports: ['websocket', 'polling']});
|
||||||
socketCallout.on('connect', function () {
|
socketCallout.on('connect', function () {
|
||||||
console.log("Callout 连接初始化成功");
|
console.log("Callout 连接初始化成功");
|
||||||
//请求服务端记录 当前用户在线事件
|
//请求服务端记录 当前用户在线事件
|
||||||
|
@ -5,7 +5,7 @@ newmessage['mp3'] = '/images/message.mp3';
|
|||||||
ring['mp3'] = '/images/ring.mp3';
|
ring['mp3'] = '/images/ring.mp3';
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
var protocol = window.location.protocol.replace(/:/g,'');
|
var protocol = window.location.protocol.replace(/:/g,'');
|
||||||
socket = io.connect(protocol+'://'+hostname+':'+port+'/im/agent?orgi='+orgi+"&userid="+userid+"&session="+session+"&admin="+adminuser );
|
socket = io(protocol+'://'+hostname+':'+port+'/im/agent?orgi='+orgi+"&userid="+userid+"&session="+session+"&admin="+adminuser , {transports: ['websocket', 'polling']});
|
||||||
socket.on('connect',function() {
|
socket.on('connect',function() {
|
||||||
console.log("连接初始化成功");
|
console.log("连接初始化成功");
|
||||||
//请求服务端记录 当前用户在线事件
|
//请求服务端记录 当前用户在线事件
|
||||||
|
Loading…
x
Reference in New Issue
Block a user