fixed bug for websocket message handler rebind

This commit is contained in:
RockYang
2024-10-08 16:41:19 +08:00
parent 8498cd71dc
commit c374126f69
4 changed files with 35 additions and 50 deletions

View File

@@ -689,7 +689,7 @@ const sendMessage = function () {
return;
}
if (store.socket.readyState !== WebSocket.OPEN) {
if (store.socket.conn.readyState !== WebSocket.OPEN) {
ElMessage.warning("连接断开,正在重连...");
return
}
@@ -727,7 +727,7 @@ const sendMessage = function () {
showHello.value = false
disableInput(false)
store.socket.send(JSON.stringify({
store.socket.conn.send(JSON.stringify({
channel: 'chat',
type:'text',
body:{
@@ -825,7 +825,7 @@ const reGenerate = function (prompt) {
icon: loginUser.value.avatar,
content: text
});
store.socket.send(JSON.stringify({
store.socket.conn.send(JSON.stringify({
channel: 'chat',
type:'text',
body:{

View File

@@ -512,7 +512,7 @@ const sendMessage = () => {
return
}
if (store.socket.readyState !== WebSocket.OPEN) {
if (store.socket.conn.readyState !== WebSocket.OPEN) {
showToast("连接断开,正在重连...");
return
}
@@ -536,7 +536,7 @@ const sendMessage = () => {
})
disableInput(false)
store.socket.send(JSON.stringify({
store.socket.conn.send(JSON.stringify({
channel: 'chat',
type:'text',
body:{
@@ -569,7 +569,7 @@ const reGenerate = () => {
icon: loginUser.value.avatar,
content: renderInputText(text)
});
store.socket.send(JSON.stringify({
store.socket.conn.send(JSON.stringify({
channel: 'chat',
type:'text',
body:{