feat: 添加 S3 上传功能,包含预签名 URL 获取和上传选项

This commit is contained in:
2026-01-08 13:13:35 +07:00
parent 11f332ab2f
commit 08939bec64
3 changed files with 23 additions and 0 deletions

19
src/utils/aws/s3.ts Normal file
View File

@@ -0,0 +1,19 @@
import { client, safeClient } from "@/api";
interface PresignedUrlResponse {
uploadUrl: string;
fileUrl: string;
key: string;
expiresIn: number;
}
interface UploadOptions {
onProgress?: (progress: number) => void;
signal?: AbortSignal;
}
export function uploadToS3(file: File, options: UploadOptions = {}) {
const { onProgress, signal } = options || {};
// 1. 获取预签名 URL
}

View File

@@ -1,3 +1,4 @@
export * from "./aws/s3";
export * from "./ionic-helper";
export * from "./is";
export * from "./pattern";