feat: 支付凭证
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m22s

This commit is contained in:
sexygoat
2026-04-23 18:35:29 +08:00
parent cd2ca96873
commit aaa648a86d
6 changed files with 143 additions and 0 deletions

View File

@@ -34,6 +34,24 @@ export interface GetUploadUrlResponse {
expires_in: number
}
/**
* 批量获取文件下载预签名 URL 请求
*/
export interface BatchDownloadUrlsRequest {
/** 文件路径标识列表,最多 50 个 */
file_keys: string[]
}
/**
* 批量获取文件下载预签名 URL 响应
*/
export interface BatchDownloadUrlsResponse {
/** 文件下载地址映射key 为 file_key */
urls: Record<string, string>
/** URL 有效期(秒) */
expires_in: number
}
export class StorageService extends BaseService {
/**
* 获取文件上传预签名 URL
@@ -100,4 +118,18 @@ export class StorageService extends BaseService {
throw error
}
}
/**
* 批量获取文件下载预签名 URL
* 用于获取私有文件的临时下载地址
* @param data 请求参数
*/
static batchDownloadUrls(
data: BatchDownloadUrlsRequest
): Promise<BaseResponse<BatchDownloadUrlsResponse>> {
return this.post<BaseResponse<BatchDownloadUrlsResponse>>(
'/api/admin/storage/batch-download-urls',
data
)
}
}