Commit 10483aff by 施宇

213213

parent 855e12e6
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
num: "100,000", num: "100,000",
hq: "现货", hq: "现货",
} }
Util.setCookie('template', JSON.stringify(obj), 1) Util.setCookie('template', JSON.stringify(obj), 1,cookieHostname)
window.location.href = '/chat' window.location.href = '/chat'
}) })
</script> </script>
......
...@@ -7,7 +7,6 @@ $(function () { ...@@ -7,7 +7,6 @@ $(function () {
this.ieFun() this.ieFun()
this.connection(); this.connection();
this.connListen(); this.connListen();
this.bindFunction(); this.bindFunction();
this.getUserInfo(); this.getUserInfo();
}, },
...@@ -46,14 +45,14 @@ $(function () { ...@@ -46,14 +45,14 @@ $(function () {
}, ) }, )
$.ajax({ $.ajax({
type: 'post', type: 'post',
url: 'http://a1.easemob.com/1113190618181018/icsales/token', url: 'http://a1.easemob.com/'+self.orgName+'/'+self.appName+'/token',
data: data, data: data,
contentType: "application/json", contentType: "application/json",
success: function (data) { success: function (data) {
var token = data.access_token; var token = data.access_token;
$.ajax({ $.ajax({
type: 'get', type: 'get',
url: 'http://a1.easemob.com/1113190618181018/icsales/users/' + user, url: 'http://a1.easemob.com/'+self.orgName+'/'+self.appName+'/users/' + user,
headers: { headers: {
Authorization: 'Bearer ' + token Authorization: 'Bearer ' + token
}, },
...@@ -86,7 +85,7 @@ $(function () { ...@@ -86,7 +85,7 @@ $(function () {
if (JSON.stringify(templateObj) !== '{}') { if (JSON.stringify(templateObj) !== '{}') {
this.addUser(templateObj.userId, false) this.addUser(templateObj.userId, false)
this.sendCmd(templateObj); this.sendCmd(templateObj);
Util.delCookie('template'); Util.delCookie('template',cookieHostname);
} }
...@@ -129,7 +128,7 @@ $(function () { ...@@ -129,7 +128,7 @@ $(function () {
https: typeof WebIM.config.https === 'boolean' ? WebIM.config.https : location.protocol === https: typeof WebIM.config.https === 'boolean' ? WebIM.config.https : location.protocol ===
'https:', 'https:',
url: WebIM.config.xmppURL, url: WebIM.config.xmppURL,
isAutoLogin: true, isAutoLogin: false,
heartBeatWait: WebIM.config.heartBeatWait, heartBeatWait: WebIM.config.heartBeatWait,
autoReconnectNumMax: WebIM.config.autoReconnectNumMax, autoReconnectNumMax: WebIM.config.autoReconnectNumMax,
autoReconnectInterval: WebIM.config.autoReconnectInterval autoReconnectInterval: WebIM.config.autoReconnectInterval
...@@ -385,6 +384,7 @@ $(function () { ...@@ -385,6 +384,7 @@ $(function () {
// listern,添加回调函数; // listern,添加回调函数;
self.conn.listen({ self.conn.listen({
onOpened: function (message) { onOpened: function (message) {
console.log('登入成功')
self.defaultUser(); self.defaultUser();
self.singleChat(); self.singleChat();
}, },
......
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 sign in to comment