修复知识图谱文件上传 BUG

This commit is contained in:
Wenjie Zhang 2025-05-09 23:46:15 +08:00
parent 95b8b64170
commit 79d4fc79b0

View File

@ -73,6 +73,7 @@
:max-count="1" :max-count="1"
:disabled="disabled" :disabled="disabled"
action="/api/data/upload" action="/api/data/upload"
:headers="getAuthHeaders()"
@change="handleFileUpload" @change="handleFileUpload"
@drop="handleDrop" @drop="handleDrop"
> >
@ -94,6 +95,7 @@ import { useConfigStore } from '@/stores/config';
import { UploadOutlined, SyncOutlined } from '@ant-design/icons-vue'; import { UploadOutlined, SyncOutlined } from '@ant-design/icons-vue';
import HeaderComponent from '@/components/HeaderComponent.vue'; import HeaderComponent from '@/components/HeaderComponent.vue';
import { graphApi } from '@/apis/admin_api'; import { graphApi } from '@/apis/admin_api';
import { useUserStore } from '@/stores/user';
const configStore = useConfigStore(); const configStore = useConfigStore();
const cur_embed_model = computed(() => configStore.config?.embed_model_names?.[configStore.config?.embed_model]?.name || ''); const cur_embed_model = computed(() => configStore.config?.embed_model_names?.[configStore.config?.embed_model]?.name || '');
@ -384,6 +386,11 @@ const indexNodes = () => {
}); });
}; };
const getAuthHeaders = () => {
const userStore = useUserStore();
return userStore.getAuthHeaders();
};
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>