feat: allow chat model bind a fixed api key

This commit is contained in:
RockYang
2024-04-12 17:09:22 +08:00
parent 4991e50e16
commit 170b41441b
22 changed files with 183 additions and 84 deletions

View File

@@ -377,16 +377,7 @@ const initData = () => {
httpGet(`/api/role/list`).then((res) => {
roles.value = res.data;
roleId.value = roles.value[0]['id'];
const chatId = localStorage.getItem("chat_id")
const chat = getChatById(chatId)
if (chat === null) {
// 创建新的对话
newChat();
} else {
// 加载对话
loadChat(chat)
}
newChat();
}).catch((e) => {
ElMessage.error('获取聊天角色失败: ' + e.messages)
})