提交 c298460c 作者: 毛细亚

下线成功

上级 527268d4
...@@ -94,7 +94,7 @@ export function sendComment(data) { ...@@ -94,7 +94,7 @@ export function sendComment(data) {
export function client_session_rest(data) { export function client_session_rest(data) {
// 发送一个post请求,请求的url为'/sidebar/client_session/rest',请求的数据为data // 发送一个post请求,请求的url为'/sidebar/client_session/rest',请求的数据为data
return request({ return request({
url: '/sidebar/client_session/rest', url: '/sidebar/work_wei_xin/rest',
method: 'post', method: 'post',
data data
}) })
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
<p v-if="bindGameUserList.length > 0" class="num"> <p v-if="bindGameUserList.length > 0" class="num">
总共{{ bindGameUserList.length }}个账号 总共{{ bindGameUserList.length }}个账号
</p> </p>
<el-button type="danger" style="margin-left: 10px;" size="mini" @click="logout">下线</el-button>
<addUser <addUser
:show.sync="showLayer" :show.sync="showLayer"
title="选择玩家" title="选择玩家"
...@@ -53,7 +52,8 @@ export default { ...@@ -53,7 +52,8 @@ export default {
...mapState('user', [ ...mapState('user', [
'userid', 'userid',
'corp_id', 'corp_id',
'external_userid' 'external_userid',
'client_online_status'
]), ]),
}, },
watch: { watch: {
...@@ -102,39 +102,6 @@ export default { ...@@ -102,39 +102,6 @@ export default {
} }
}, },
logout(){
this.$confirm('确定下线吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.userLogout()
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
})
})
},
async userLogout(){
const data = {
userid: this.userid,
}
const res = await logout(data)
if(res.status_code === 1){
this.$message({
type: 'success',
message: '下线成功'
})
removeToken()
window.location.href = window.location.origin +'/company_app/index.html?corp_id='+this.corp_id
}else{
this.$message({
type: 'error',
message: '下线失败'
})
}
},
addNewUser() { addNewUser() {
console.log(11) console.log(11)
}, },
......
...@@ -21,19 +21,22 @@ ...@@ -21,19 +21,22 @@
> >
<p>高风险用户,禁止转端 !!!</p> <p>高风险用户,禁止转端 !!!</p>
</div> </div>
<div class="cser_info">
<div class="cser_name"> <div class="cser_name">
<span>当前客服:{{ `${cser_name}(${clientStatusText})` }}</span> <span>当前客服:{{ `${cser_name}(${clientStatusText})` }}</span>
</div> </div>
<!-- 添加客服状态显示及按钮 --> <!-- 添加客服状态显示及按钮 -->
<div class="cser_status"> <div class="cser_status">
<div class="status-actions"> <div class="status-actions">
<el-button type="danger" style="margin-left: 0px;" size="mini" @click="logout">下线</el-button>
<!-- 休息中状态显示结束休息按钮 --> <!-- 休息中状态显示结束休息按钮 -->
<el-button v-if="clientStatus === 'rest'" type="primary" size="mini" @click="handleFinishRest">结束休息</el-button> <el-button v-if="clientStatus === 'rest'" type="primary" size="mini" @click="handleFinishRest">结束休息</el-button>
<!-- 在线状态显示开始休息按钮 --> <!-- 在线状态显示开始休息按钮 -->
<el-button v-if="clientStatus === 'online'" type="warning" size="mini" @click="handleStartRest" <el-button v-if="clientStatus === 'online'" type="warning" size="mini" @click="handleStartRest"
title="午休或者临时有事可点击休息">开始休息</el-button> title="午休或者临时有事可点击休息">开始休息</el-button>
<!-- 发送评价按钮 --> <!-- 发送评价按钮 -->
<el-button type="primary" size="mini" @click="handleSendComment">发送评价</el-button> <el-button type="primary" style="margin-left: 0px;" size="mini" @click="handleSendComment">发送评价</el-button>
</div>
</div> </div>
</div> </div>
<!-- 会话内容存档状态 --> <!-- 会话内容存档状态 -->
...@@ -201,9 +204,9 @@ import watchMember from '@/mixins/watchMember' ...@@ -201,9 +204,9 @@ import watchMember from '@/mixins/watchMember'
import { autoResetPassword,bindUserSelfAdd } from '@/api/game' import { autoResetPassword,bindUserSelfAdd } from '@/api/game'
import { memberBindCser,editUser,zyouUnBind } from '@/api/works' import { memberBindCser,editUser,zyouUnBind } from '@/api/works'
import selectTag from '@/components/selectTag.vue' import selectTag from '@/components/selectTag.vue'
import { getClientStatus, remarkSessionIntelTag, finishRest, client_session_rest, checkSingleAgree, checkUserPermit, sendComment } from '@/api/user.js' import { getClientStatus, remarkSessionIntelTag, finishRest, client_session_rest, checkSingleAgree, checkUserPermit, sendComment, logout } from '@/api/user.js'
import { sendChatMessage } from '@/utils/index.js' import { sendChatMessage } from '@/utils/index.js'
import { getToken,removeToken } from '@/utils/auth'
export default { export default {
name: 'UserDetailsPanel', name: 'UserDetailsPanel',
components: { components: {
...@@ -232,7 +235,6 @@ import watchMember from '@/mixins/watchMember' ...@@ -232,7 +235,6 @@ import watchMember from '@/mixins/watchMember'
changePhone:false, changePhone:false,
showTag:false, showTag:false,
// 新增状态数据 // 新增状态数据
clientStatus: '', // 客服休息状态:online上线 offline下线 rest休息中
agreeStatus: '', // 用户是否同意聊天内容存档:Agreen同意 Disagree不同意 agreeStatus: '', // 用户是否同意聊天内容存档:Agreen同意 Disagree不同意
hasPermit: false, // 客服号是否开启会话内容存档权限 hasPermit: false, // 客服号是否开启会话内容存档权限
} }
...@@ -253,6 +255,10 @@ import watchMember from '@/mixins/watchMember' ...@@ -253,6 +255,10 @@ import watchMember from '@/mixins/watchMember'
} }
return statusMap[this.client_online_status] || '未知' return statusMap[this.client_online_status] || '未知'
}, },
// 客服休息状态:online上线 offline下线 rest休息中
clientStatus() {
return this.client_online_status
},
// 用户是否同意聊天内容存档文本 // 用户是否同意聊天内容存档文本
agreeStatusText() { agreeStatusText() {
return this.agreeStatus === 'Agreen' ? '已' : '未' return this.agreeStatus === 'Agreen' ? '已' : '未'
...@@ -285,6 +291,46 @@ import watchMember from '@/mixins/watchMember' ...@@ -285,6 +291,46 @@ import watchMember from '@/mixins/watchMember'
console.error('❌ 企业微信 SDK 初始化失败:', error) console.error('❌ 企业微信 SDK 初始化失败:', error)
} }
}, },
logout(){
if(this.client_online_status === 'rest'){
this.$message({
type: 'error',
message: '当前客服号处于休息状态,不能下线'
})
return
}
this.$confirm('确定下线吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.userLogout()
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
})
})
},
async userLogout(){
const data = {
userid: this.userid,
}
const res = await logout(data)
if(res.status_code === 1){
this.$message({
type: 'success',
message: '下线成功'
})
removeToken()
window.location.href = window.location.origin +'/company_app/index.html?corp_id='+this.corp_id
}else{
this.$message({
type: 'error',
message: '下线失败'
})
}
},
// 获取初始数据 // 获取初始数据
async getInitialData() { async getInitialData() {
...@@ -611,7 +657,6 @@ import watchMember from '@/mixins/watchMember' ...@@ -611,7 +657,6 @@ import watchMember from '@/mixins/watchMember'
justify-content: space-between; justify-content: space-between;
margin-bottom: 10px; margin-bottom: 10px;
font-size: 14px; font-size: 14px;
.status-actions { .status-actions {
display: flex; display: flex;
gap: 10px; gap: 10px;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论