reactor:【INFRA】文件上传 api,增加 directory 参数,去除 path 参数,并支持按照日期分目录、文件名不再使用 sha256 而是时间戳

This commit is contained in:
YunaiV
2025-05-02 19:58:59 +08:00
parent 8c4e1b7c72
commit f5b48f8e8c
5 changed files with 29 additions and 23 deletions

View File

@ -8,6 +8,8 @@ export interface FilePresignedUrlRespVO {
uploadUrl: string
// 文件 URL
url: string
// 文件路径
path: string
}
// 查询文件列表
@ -21,10 +23,10 @@ export const deleteFile = (id: number) => {
}
// 获取文件预签名地址
export const getFilePresignedUrl = (path: string) => {
export const getFilePresignedUrl = (name: string, directory?: string) => {
return request.get<FilePresignedUrlRespVO>({
url: '/infra/file/presigned-url',
params: { path }
params: { name, directory }
})
}