mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-12 12:13:46 +08:00
rename Token to User, the chat history function is ready
This commit is contained in:
@@ -185,10 +185,13 @@ export default defineComponent({
|
||||
|
||||
window.addEventListener("resize", () => {
|
||||
this.chatBoxHeight = window.innerHeight - this.toolBoxHeight;
|
||||
this.inputBoxWidth = window.innerWidth - 20;
|
||||
});
|
||||
|
||||
this.connect();
|
||||
|
||||
this.fetchChatHistory();
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
@@ -300,6 +303,17 @@ export default defineComponent({
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
this.fetchChatHistory();
|
||||
},
|
||||
|
||||
// 从后端获取聊天历史记录
|
||||
fetchChatHistory: function () {
|
||||
httpPost("/api/chat/history", {role: this.role}).then((res) => {
|
||||
this.chatData = res.data
|
||||
}).catch((e) => {
|
||||
console.error(e.message)
|
||||
})
|
||||
},
|
||||
|
||||
inputKeyDown: function (e) {
|
||||
|
||||
Reference in New Issue
Block a user