diff --git a/src/store/historySession.ts b/src/store/historySession.ts index 3b14e00d2c3d2f6d688b85643f56a47421d7cced..94f2c3a7ceeef32581eb771ddd42e983a89de369 100644 --- a/src/store/historySession.ts +++ b/src/store/historySession.ts @@ -81,6 +81,8 @@ export const useHistorySessionStore = defineStore( * 获取当前 llm 模型的数值 */ const currentLLM = async () => { + // 先置空 + selectLLM.value = {}; await getHistorySession(); historySession.value.forEach((item) => { if (item.conversationId === currentSelectedSession.value) { diff --git a/src/views/dialogue/components/DialogueAside.vue b/src/views/dialogue/components/DialogueAside.vue index 976c1749eee3d0bf0db2aafcf53fab00598d7f66..68d512736f7cc72b18f44a1e443194a38b0d7587 100644 --- a/src/views/dialogue/components/DialogueAside.vue +++ b/src/views/dialogue/components/DialogueAside.vue @@ -125,9 +125,18 @@ function checkDate(date: string | Date): string { onMounted(() => { getHistorySession(); - currentLLM(); }); +watch( + () => currentSelectedSession.value, + () => { + currentLLM(); + }, + { + immediate: true, + } +); + const deletedSessionName = ref(''); const sessionList = ref(); /**