作者 whf

2019-5-27 14:21

body {
background: #f5f5f5;
}
.bad-network {
line-height: 38px;
background-color: #7c858b;
... ...
... ... @@ -163,6 +163,11 @@ body {
text-align: center;
background: #569df6;
}
.title .exitBtn{
position: absolute;
right:10px;
cursor: pointer;
}
#cloudMsgContainer .title{
height: 90px;
line-height: 90px;
... ...
... ... @@ -107,7 +107,6 @@ var SDKBridge = function (ctr, data) {
switch (error.code) {
// 账号或者密码错误, 请跳转到登录页面并提示错误
case 302:
alert(error.message);
delCookie('uid');
delCookie('sdktoken');
delCookie('nickName');
... ...
$(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)
})
}
}
$(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"
})
})
\ No newline at end of file
... ...
... ... @@ -32,6 +32,7 @@
<div class="hide loading" id="loading"></div>
<div class="title">
<span>对客服说列表</span>
<span class="exitBtn" id="exitBtn">退出</span>
</div>
<div class="m-devices hide">正在使用云信web版</div>
<div class="panel" id="switchPanel">
... ... @@ -590,7 +591,6 @@
<script src="js/module/personCard.js"></script>
<script src="js/module/session.js"></script>
<script src="js/module/friend.js"></script>
<script src="js/module/team.js"></script>
<script src="js/module/dialog_team.js"></script>
<script src="js/module/cloudMsg.js"></script>
... ... @@ -601,6 +601,7 @@
<script src="js/module/dialog_call_method.js"></script>
<script src="js/main.js?v=2"></script>
<script src="../3rd/vue.min.js"></script>
<script src="js/talk.js"></script>
<script id="whiteboard-template" type="text/x-template">
<div v-show="display" class="function-box whiteboard">
<div v-if="banner.length" class="whiteboard-banner">
... ... @@ -676,7 +677,7 @@
<div class="dialogs"></div>
</div>
</script>
<!-- <script src="js/talk.js"></script> -->
</body>
</html>
\ No newline at end of file
... ...