From 409a302f9b5021c405be9a2f00d7f230583ba6a6 Mon Sep 17 00:00:00 2001 From: fxjhello <127916299+fxjhello@users.noreply.github.com> Date: Sat, 17 Jun 2023 20:29:25 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"fix:=E5=89=8D=E7=AB=AF=E7=9F=A5?= =?UTF-8?q?=E8=AF=86=E5=BA=93=E8=8E=B7=E5=8F=96=E5=A4=B1=E8=B4=A5.=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96=E5=8F=8A=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=87=B3knowledge=5Fbase"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- views/src/api/chat.ts | 16 ---------------- .../chat/layout/sider/knowledge-base/index.vue | 8 ++++---- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/views/src/api/chat.ts b/views/src/api/chat.ts index faf4a36..41f9f99 100644 --- a/views/src/api/chat.ts +++ b/views/src/api/chat.ts @@ -24,15 +24,6 @@ export const getfilelist = (knowledge_base_id: any) => { }) } - -export const getkblist = (knowledge_base_id: any) => { - return api({ - url: '/local_doc_qa/list_knowledge_base', - method: 'get', - params: {}, - - }) -} export const bing_search = (params: any) => { return api({ url: '/local_doc_qa/bing_search_chat', @@ -48,13 +39,6 @@ export const deletefile = (params: any) => { data: JSON.stringify(params), }) } -export const deletekb = (params: any) => { - return api({ - url: '/local_doc_qa/delete_knowledge_base', - method: 'post', - data: JSON.stringify(params), - }) -} export const web_url = () => { return window.location.origin } 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 43b263e..73272e6 100644 --- a/views/src/views/chat/layout/sider/knowledge-base/index.vue +++ b/views/src/views/chat/layout/sider/knowledge-base/index.vue @@ -3,7 +3,7 @@ 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 { getkblist, deletekb} from '@/api/chat' +import { deletefile, getfilelist } from '@/api/chat' import { idStore } from '@/store/modules/knowledgebaseid/id' const items = ref([]) const choice = ref('') @@ -11,7 +11,7 @@ const store = idStore() onMounted(async () => { choice.value = store.knowledgeid - const res = await getkblist({}) + const res = await getfilelist({}) res.data.data.forEach((item: any) => { items.value.push({ value: item, @@ -52,8 +52,8 @@ const handleClick = () => { } } async function handleDelete(item: any) { - await deletekb(item.value) - const res = await getkblist({}) + await deletefile(item.value) + const res = await getfilelist({}) items.value = [] res.data.data.forEach((item: any) => { items.value.push({