文件上传下载修正

This commit is contained in:
2025-12-20 15:14:44 +08:00
parent 9b6e959973
commit 81508a1fdc
28 changed files with 1059 additions and 192 deletions

View File

@@ -80,14 +80,19 @@ export const aiKnowledgeAPI = {
// ====================== 文件管理 ======================
/**
* 获取知识库文档列表
* 获取知识库文档列表(查询本地数据库文件)
* @param knowledgeId 知识库ID
* @param page 页码
* @param limit 每页条数
* @param pageSize 每页条数
*/
async getDocumentList(knowledgeId: string, page = 1, limit = 20): Promise<ResultDomain<Record<string, any>>> {
const response = await api.get<Record<string, any>>(`${this.baseUrl}/${knowledgeId}/documents`, {
params: { page, limit }
async getDocumentList(knowledgeId: string, page = 1, pageSize = 20): Promise<ResultDomain<any>> {
const response = await api.post<any>(`${this.baseUrl}/${knowledgeId}/documents`, {
filter: { knowledgeId },
pageParam: {
page,
pageSize,
total: 0
}
})
return response.data
},

View File

@@ -2,7 +2,7 @@ import { api } from '@/api/index'
import { BatchFileUploadParam, FileUploadParam, ResultDomain, TbSysFileDTO } from '@/types';
export const fileAPI = {
baseUrl: "/file",
baseUrl: "/urban-lifeline/file",
/**
* 上传文件

View File

@@ -0,0 +1,9 @@
<template>
</template>
<script setup lang="ts">
</script>
<style scoped lang="scss">
@import url("./DocumentDetail.scss");
</style>

View File

@@ -0,0 +1 @@
export {default as DocumentDetail} from './DocumentDetail/DocumentDetail.vue'

View File

@@ -1,6 +1,7 @@
export * from './fileupload'
export * from './base'
export * from './dynamicFormItem'
export * from './ai'
// 通用视图组件
export { default as IframeView } from './iframe/IframeView.vue'

View File

@@ -76,8 +76,8 @@ const devConfig: AppRuntimeConfig = {
file: {
// 同样走代理,保持与 api.baseUrl 一致
downloadUrl: '/api/file/download/',
uploadUrl: '/api/file/upload',
downloadUrl: '/api/urban-lifeline/file/download/',
uploadUrl: '/api/urban-lifeline/file/upload',
maxSize: {
image: 5,
video: 100,