fix: fixed bug for concurrency risk for getting token for chat histroy with issue #92

This commit is contained in:
RockYang
2024-01-04 09:03:19 +08:00
parent d8e4308b1b
commit 039b70eed2
2 changed files with 6 additions and 5 deletions

View File

@@ -634,7 +634,7 @@ const connect = function (chat_id, role_id) {
// 获取 token
const reply = chatData.value[chatData.value.length - 1]
httpPost("/api/chat/tokens", {text: "", model: getModelValue(modelID.value)}).then(res => {
httpPost("/api/chat/tokens", {text: "", model: getModelValue(modelID.value), chat_id: chat_id}).then(res => {
reply['created_at'] = new Date().getTime();
reply['tokens'] = res.data;
// 将聊天框的滚动条滑动到最底部