提交 3efd408f 作者: 敬文 | 罗千洪

fix(前端): 删除知识库改为使用删除知识库接口

上级 7cbdc670
...@@ -24,6 +24,16 @@ export const getKbsList = () => { ...@@ -24,6 +24,16 @@ export const getKbsList = () => {
}) })
} }
export const deleteKb = (knowledge_base_id: any) => {
return api({
url: '/local_doc_qa/delete_knowledge_base',
method: 'delete',
params: {
knowledge_base_id,
},
})
}
export const getfilelist = (knowledge_base_id: any) => { export const getfilelist = (knowledge_base_id: any) => {
return api({ return api({
url: '/local_doc_qa/list_files', url: '/local_doc_qa/list_files',
......
...@@ -3,7 +3,7 @@ import { NButton, NForm, NFormItem, NInput, NPopconfirm } from 'naive-ui' ...@@ -3,7 +3,7 @@ import { NButton, NForm, NFormItem, NInput, NPopconfirm } from 'naive-ui'
import { onMounted, ref } from 'vue' import { onMounted, ref } from 'vue'
import filelist from './filelist.vue' import filelist from './filelist.vue'
import { SvgIcon } from '@/components/common' import { SvgIcon } from '@/components/common'
import { deletefile, getKbsList, getfilelist } from '@/api/chat' import { deleteKb, getKbsList } from '@/api/chat'
import { idStore } from '@/store/modules/knowledgebaseid/id' import { idStore } from '@/store/modules/knowledgebaseid/id'
const items = ref<any>([]) const items = ref<any>([])
...@@ -53,8 +53,8 @@ const handleClick = () => { ...@@ -53,8 +53,8 @@ const handleClick = () => {
} }
} }
async function handleDelete(item: any) { async function handleDelete(item: any) {
await deletefile(item.value) await deleteKb(item.value)
const res = await getfilelist({}) const res = await getKbsList()
items.value = [] items.value = []
res.data.data.forEach((item: any) => { res.data.data.forEach((item: any) => {
items.value.push({ items.value.push({
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论