talk.js
1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
$(function () {
// if(readCookie('accountList')) {
// var accountList = JSON.parse(readCookie('accountList'))
// //判断如果是老板登录 则显示客服列表
// if(readCookie('flag') == 1) {
// var oDiv = $("<div id='selectWrap'></div>")
// var oSpan = $("<span class='selectTitle'>客服列表</span>")
// var oSelect = $("<select id='changeAccount'></select>")
// for(var i = 0; i < accountList.length; i++) {
// oSelect.append("<option value='" + accountList[i].token + "' uid='" + accountList[i].accid + "'>" + accountList[i].name + "</option>");
// }
// oDiv.prepend(oSelect)
// oDiv.prepend(oSpan)
// $("body").prepend(oDiv)
// if(readCookie('currentSelect')) {
// var uid = readCookie('currentSelect')
// oSelect.find("option[uid='" + uid + "']").attr("selected", true);
// }
// oSelect.change(function() {
// setCookie('currentSelect', oSelect.find("option:checked").attr("uid"));
// YX.fn.doLogout()
// setCookie('uid', oSelect.find("option:checked").attr("uid"));
// setCookie('sdktoken', oSelect.val())
// setTimeout(function() {
// window.location.reload()
// }, 500)
// })
// }
// }
let exitBtn = $("#exitBtn")
exitBtn.click(function () {
delCookie('uid');
delCookie('sdktoken');
delCookie('nickName');
delCookie('avatar')
delCookie('flag')
window.location.href = "../im/login.html"
})
})