From 7fcbec34097cb1cd1f4876a729fcef3233907752 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 15 May 2023 04:44:28 +0000 Subject: [PATCH] fixed bug of upload file use fixed url --- views/src/api/chat.ts | 3 +++ .../src/views/chat/layout/sider/knowledge-base/filelist.vue | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/views/src/api/chat.ts b/views/src/api/chat.ts index 08d7957..24d9425 100644 --- a/views/src/api/chat.ts +++ b/views/src/api/chat.ts @@ -32,3 +32,6 @@ export const deletefile = (params: any) => { data: JSON.stringify(params), }) } +export const web_url = () => { + return window.location.origin +} diff --git a/views/src/views/chat/layout/sider/knowledge-base/filelist.vue b/views/src/views/chat/layout/sider/knowledge-base/filelist.vue index 55cbdc4..2293122 100644 --- a/views/src/views/chat/layout/sider/knowledge-base/filelist.vue +++ b/views/src/views/chat/layout/sider/knowledge-base/filelist.vue @@ -3,7 +3,7 @@ import { onMounted, ref, toRef } from 'vue' import { NInput, NP, NPopconfirm, NScrollbar, NText, NUpload, NUploadDragger } from 'naive-ui' import { SvgIcon } from '@/components/common' import { useChatStore } from '@/store' -import { deletefile, getfilelist } from '@/api/chat' +import { deletefile, getfilelist, web_url } from '@/api/chat' const knowledge = defineProps({ knowledgebaseid: { type: String, // 类型字符串 @@ -35,13 +35,14 @@ function handleEnter({ uuid }: Chat.History, isEdit: boolean, event: KeyboardEve if (event.key === 'Enter') chatStore.updateHistory(uuid, { isEdit }) } +console.log(`${web_url()}/api/local_doc_qa/upload_file`)