diff --git a/fund-admin/src/api/file.js b/fund-admin/src/api/file.js new file mode 100644 index 0000000..e56f0b5 --- /dev/null +++ b/fund-admin/src/api/file.js @@ -0,0 +1,67 @@ +import request from '../utils/request' + +/** + * 上传文件 + */ +export const uploadFile = (data) => { + return request({ + url: '/sys/api/v1/file/upload', + method: 'post', + data, + headers: { + 'Content-Type': 'multipart/form-data' + } + }) +} + +/** + * 获取文件列表(分页) + */ +export const getFileList = (params) => { + return request({ + url: '/sys/api/v1/file/list', + method: 'get', + params + }) +} + +/** + * 根据业务类型和ID查询文件列表 + */ +export const getFileListByBusiness = (businessType, businessId) => { + return request({ + url: '/sys/api/v1/file/list/business', + method: 'get', + params: { businessType, businessId } + }) +} + +/** + * 获取文件详情 + */ +export const getFileById = (fileId) => { + return request({ + url: `/sys/api/v1/file/${fileId}`, + method: 'get' + }) +} + +/** + * 删除文件 + */ +export const deleteFile = (fileId) => { + return request({ + url: `/sys/api/v1/file/${fileId}`, + method: 'delete' + }) +} + +/** + * 获取文件访问URL + */ +export const getFileUrl = (fileId) => { + return request({ + url: `/sys/api/v1/file/${fileId}/url`, + method: 'get' + }) +} diff --git a/fund-admin/src/views/system/file.vue b/fund-admin/src/views/system/file.vue new file mode 100644 index 0000000..e413b31 --- /dev/null +++ b/fund-admin/src/views/system/file.vue @@ -0,0 +1,402 @@ + + + + +