mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-08 02:03:42 +08:00
fixed bug for websocket close tip message
This commit is contained in:
@@ -734,23 +734,7 @@ const connect = () => {
|
||||
|
||||
_socket.addEventListener('close', () => {
|
||||
if (socket.value !== null) {
|
||||
ElMessageBox.confirm(
|
||||
'检测到您已经在其他客户端创建了新的连接,当前连接将被关闭!',
|
||||
'提示',
|
||||
{
|
||||
dangerouslyUseHTMLString: true,
|
||||
confirmButtonText: '重新连接',
|
||||
cancelButtonText: '关闭',
|
||||
type: 'warning',
|
||||
}
|
||||
).then(() => {
|
||||
connect()
|
||||
}).catch(() => {
|
||||
ElMessage({
|
||||
type: 'info',
|
||||
message: '连接已关闭',
|
||||
})
|
||||
})
|
||||
connect()
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -577,23 +577,7 @@ const connect = () => {
|
||||
|
||||
_socket.addEventListener('close', () => {
|
||||
if (socket.value !== null) {
|
||||
ElMessageBox.confirm(
|
||||
'检测到您已经在其他客户端创建了新的连接,当前连接将被关闭!',
|
||||
'提示',
|
||||
{
|
||||
dangerouslyUseHTMLString: true,
|
||||
confirmButtonText: '重新连接',
|
||||
cancelButtonText: '关闭',
|
||||
type: 'warning',
|
||||
}
|
||||
).then(() => {
|
||||
connect()
|
||||
}).catch(() => {
|
||||
ElMessage({
|
||||
type: 'info',
|
||||
message: '连接已关闭',
|
||||
})
|
||||
})
|
||||
connect()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -254,23 +254,7 @@ const connect = (userId) => {
|
||||
_socket.addEventListener('close', () => {
|
||||
loading.value = false
|
||||
if (socket.value !== null) {
|
||||
ElMessageBox.confirm(
|
||||
'检测到您已经在其他客户端创建了新的连接,当前连接将被关闭!',
|
||||
'提示',
|
||||
{
|
||||
dangerouslyUseHTMLString: true,
|
||||
confirmButtonText: '重新连接',
|
||||
cancelButtonText: '关闭',
|
||||
type: 'warning',
|
||||
}
|
||||
).then(() => {
|
||||
connect(userId)
|
||||
}).catch(() => {
|
||||
ElMessage({
|
||||
type: 'info',
|
||||
message: '连接已关闭',
|
||||
})
|
||||
})
|
||||
connect(userId)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user