diff --git a/views/src/api/chat.ts b/views/src/api/chat.ts index 41f9f99..12d9ca3 100644 --- a/views/src/api/chat.ts +++ b/views/src/api/chat.ts @@ -16,6 +16,14 @@ export const chatfile = (params: any) => { }) } +export const getKbsList = () => { + return api({ + url: '/local_doc_qa/list_knowledge_base', + method: 'get', + + }) +} + export const getfilelist = (knowledge_base_id: any) => { return api({ url: '/local_doc_qa/list_files', @@ -35,8 +43,8 @@ export const bing_search = (params: any) => { export const deletefile = (params: any) => { return api({ url: '/local_doc_qa/delete_file', - method: 'post', - data: JSON.stringify(params), + method: 'delete', + params, }) } export const web_url = () => { diff --git a/views/src/views/chat/layout/sider/knowledge-base/index.vue b/views/src/views/chat/layout/sider/knowledge-base/index.vue index 73272e6..2b0030b 100644 --- a/views/src/views/chat/layout/sider/knowledge-base/index.vue +++ b/views/src/views/chat/layout/sider/knowledge-base/index.vue @@ -3,15 +3,16 @@ import { NButton, NForm, NFormItem, NInput, NPopconfirm } from 'naive-ui' import { onMounted, ref } from 'vue' import filelist from './filelist.vue' import { SvgIcon } from '@/components/common' -import { deletefile, getfilelist } from '@/api/chat' +import { deletefile, getKbsList, getfilelist } from '@/api/chat' import { idStore } from '@/store/modules/knowledgebaseid/id' + const items = ref([]) const choice = ref('') const store = idStore() onMounted(async () => { choice.value = store.knowledgeid - const res = await getfilelist({}) + const res = await getKbsList() res.data.data.forEach((item: any) => { items.value.push({ value: item,