From 7cbdc6702ef07e637b269aa280ef4096e156221f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=95=AC=E6=96=87=20=7C=20=E7=BD=97=E5=8D=83=E6=B4=AA?= Date: Sat, 17 Jun 2023 02:40:38 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=89=8D=E7=AB=AF):=20=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E5=88=B0=E7=9F=A5=E8=AF=86=E5=BA=93tab?= =?UTF-8?q?=E6=97=B6,=E5=BA=94=E8=AF=A5=E8=B0=83=E7=94=A8=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E7=9F=A5=E8=AF=86=E5=BA=93=E5=88=97=E8=A1=A8=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E8=80=8C=E4=B8=8D=E6=98=AF=E6=96=87=E4=BB=B6=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=8E=A5=E5=8F=A3;=E5=88=A0=E9=99=A4=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=94=B9=E4=B8=BA=E4=BD=BF=E7=94=A8DELETE=E6=96=B9?= =?UTF-8?q?=E6=B3=95,=E5=8F=82=E6=95=B0=E6=8C=89api.py=E6=94=B9=E5=8A=A8?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=B8=BAQueryParam?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- views/src/api/chat.ts | 12 ++++++++++-- .../views/chat/layout/sider/knowledge-base/index.vue | 5 +++-- 2 files changed, 13 insertions(+), 4 deletions(-) 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,