Unverified 提交 11f5d387 作者: fxjhello 提交者: GitHub

Merge pull request #362 from halfss/dev

fixed bug of upload file use fixed url
......@@ -32,3 +32,6 @@ export const deletefile = (params: any) => {
data: JSON.stringify(params),
})
}
export const web_url = () => {
return window.location.origin
}
......@@ -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`)
</script>
<template>
<NUpload
multiple
directory-dnd
action="http://127.0.0.1:1002/api/local_doc_qa/upload_file"
:action="`${web_url()}/api/local_doc_qa/upload_file`"
:headers="{
'naive-info': 'hello!',
}"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论