【功能新增】现已支持前端文件直传到OSS服务器

This commit is contained in:
卢越
2024-09-24 17:16:38 +08:00
parent 56182dfbe9
commit c23e7ac3d0
5 changed files with 158 additions and 35 deletions
+21
View File
@@ -1,4 +1,5 @@
import { baseUrl, apiPath, tenantId } from '@/sheep/config';
import request from '@/sheep/request';
const FileApi = {
// 上传文件
@@ -40,6 +41,26 @@ const FileApi = {
});
});
},
// 获取文件预签名地址
getFilePresignedUrl: (path) => {
return request({
url: '/infra/file/presigned-url',
method: 'GET',
params: {
path,
},
});
},
// 创建文件
createFile: (data) => {
return request({
url: '/infra/file/create', // 请求的 URL
method: 'POST', // 请求方法
data: data, // 要发送的数据
});
},
};
export default FileApi;