Unverified 提交 6195a597 作者: fxjhello 提交者: GitHub

Merge pull request #651 from sivdead/fix/kbs_interface_adjust

前端知识库相关接口报错修复
......@@ -16,6 +16,24 @@ export const chatfile = (params: any) => {
})
}
export const getKbsList = () => {
return api({
url: '/local_doc_qa/list_knowledge_base',
method: 'get',
})
}
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) => {
return api({
url: '/local_doc_qa/list_files',
......@@ -35,8 +53,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 = () => {
......
......@@ -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 { deletekb, getkblist } from '@/api/chat'
import { deleteKb, getKbsList } from '@/api/chat'
import { idStore } from '@/store/modules/knowledgebaseid/id'
const items = ref<any>([])
const choice = ref('')
const store = idStore()
onMounted(async () => {
choice.value = store.knowledgeid
const res = await getkblist({})
const res = await getKbsList()
res.data.data.forEach((item: any) => {
items.value.push({
value: item,
......@@ -52,8 +53,8 @@ const handleClick = () => {
}
}
async function handleDelete(item: any) {
await deletekb(item.value)
const res = await getkblist({})
await deleteKb(item.value)
const res = await getKbsList()
items.value = []
res.data.data.forEach((item: any) => {
items.value.push({
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论