|
|
@@ -201,7 +201,7 @@ const getHeaders = () => {
|
|
|
return {
|
|
|
'Content-Type': 'application/json',
|
|
|
'Authorization': token ? `Bearer ${token}` : '',
|
|
|
- 'clientid': 'talk-web'
|
|
|
+ 'clientid': '812b745b34558590c92e6f13fe8b716b'
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -687,16 +687,16 @@ const startChat = async () => {
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
- // 使用新的状态更新接口(带并发控制)
|
|
|
- const response = await fetch(`http://localhost:8080/talk/admin/agent/${selectedAgent.value}/status/2`, {
|
|
|
- method: 'PUT',
|
|
|
+ // 调用对话前端的开始对话接口(带并发控制)
|
|
|
+ const response = await fetch(`http://localhost:8080/talk/agent/${selectedAgent.value}/start`, {
|
|
|
+ method: 'POST',
|
|
|
headers: getHeaders()
|
|
|
})
|
|
|
|
|
|
const result = await response.json()
|
|
|
|
|
|
// 检查后端返回结果,判断是否成功占用客服
|
|
|
- if (!response.ok || result.code !== 200) {
|
|
|
+ if (!result.success || result.code !== 200) {
|
|
|
ElMessage.error(result.msg || '该客服已被其他用户占用,请选择其他客服')
|
|
|
// 刷新客服列表
|
|
|
await fetchAgents(true)
|