提交 6d452c53 authored 作者: 王鹏飞's avatar 王鹏飞

chore: update

上级 17925977
......@@ -16,6 +16,13 @@ export function useChat() {
method: 'POST',
headers: { authKey, timestamp, sign, 'Content-Type': 'application/json' },
body: JSON.stringify({ ...data, chatId: chatId.value, agentId: 'f3846153ba784b6d86bdcd5533259c88' }),
async onopen(response) {
if (response.ok) {
return response
} else {
throw response
}
},
onmessage(res) {
console.log(res.data)
const message = JSON.parse(res.data)
......@@ -29,6 +36,9 @@ export function useChat() {
} else {
messages.value[messageIndex].content = messages.value[messageIndex].content + content
}
},
onerror(err) {
throw err
}
})
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论