diff --git a/src/i18n/lang/en.ts b/src/i18n/lang/en.ts index 2c2601a9ad25c84fc9c009dfb4017cfd9ca7c8d1..8799027a3e4cf4c6aa5c27e410fb92447273b2f2 100644 --- a/src/i18n/lang/en.ts +++ b/src/i18n/lang/en.ts @@ -173,6 +173,7 @@ export default { }, witChainD: { witChainD: "WitChainD", + witChainD_id: "id", describe_the_witChainD: "Please enter witChainD id", }, flow: { diff --git a/src/store/conversation.ts b/src/store/conversation.ts index 2dd5b22230caeaaad6f43d863322939f07da23cd..5e0971838137d0491e412adb65fd33ee660ab70a 100644 --- a/src/store/conversation.ts +++ b/src/store/conversation.ts @@ -459,7 +459,6 @@ export const useSessionStore = defineStore('conversation', () => { user_selected_flow?: string, params?: any, ): Promise => { - const groupId = groupId?groupId:""; const { updateSessionTitle, currentSelectedSession } = useHistorySessionStore(); if (conversationList.value.length === 0) { // 如果当前还没有对话记录,将第一个问题的questtion作为对话标题 diff --git a/src/views/dialogue/dialogueView.vue b/src/views/dialogue/dialogueView.vue index b024abdd39fdc33b405c502d6422d289f704dbaa..fb0b0ce012ac753fdc8d49de67a188817f68b49c 100644 --- a/src/views/dialogue/dialogueView.vue +++ b/src/views/dialogue/dialogueView.vue @@ -20,6 +20,7 @@ import AppIconSelected from '@/assets/svgs/appIconSelected.svg'; import WitchainDIcon from '@/assets/images/witchainD.png'; import WitchainDIconSelected from '@/assets/svgs/WitchainDSelected.svg'; import { useRouter } from 'vue-router'; +import { reactive } from 'vue'; // 挂载全局事件 window.onHtmlEventDispatch = onHtmlEventDispatch as any; const { logout } = useAccountStore(); @@ -50,9 +51,8 @@ export interface ModelForm { openai_api_key?: string; [property: string]: any; } -const kb_id = localStorage.getItem('kb_id') || ''; -const ruleForm = ref({ - kb_id: kb_id, +const ruleForm = reactive({ + kb_id: "", }); const rules = ref(); @@ -144,13 +144,14 @@ const lang = computed(() => (language.value === 'EN' ? 'English' : '简体中文 const handleConfirmCreateModel = async (formData: any | undefined) => { const [_, res] = await api.updateKnowledgeList({ - kb_id: ruleForm.value.kb_id || '', + kb_id: ruleForm.kb_id || '', }); if (!_ && res) { - localStorage.setItem('kb_id', ruleForm.value.kb_id || ''); + localStorage.setItem('kb_id', ruleForm.kb_id || ''); ElMessage.success('成功'); KnowledgeVisible.value = false; } else { + ruleForm.kb_id = ''; ElMessage.error('失败'); KnowledgeVisible.value = false; } @@ -171,15 +172,18 @@ onMounted(() => { api.getKnowledgeList().then(res => { ruleForm.value = res; }); + if(localStorage.getItem('kb_id')){ + ruleForm.kb_id = localStorage.getItem('kb_id'); + } }); watch( ruleForm, () => { let flag = false; - Object.keys(ruleForm.value).forEach(item => { + Object.keys(ruleForm).forEach(item => { if (rules.value?.[item]?.[0]?.required) { - if (!ruleForm.value?.[item]?.toString()?.length) { + if (!ruleForm?.[item]?.toString()?.length) { flag = true; } } @@ -294,7 +298,7 @@ watch( title="WitChainD" > - +