封装ossStore

This commit is contained in:
2025-06-17 16:53:53 +08:00
parent 2f131e50ee
commit 1d4a3d1e29
5 changed files with 203 additions and 110 deletions

View File

@@ -1,11 +1,13 @@
import fetcher from "../fetcher";
export interface StsToken {
AccessKeyId: string;
AccessKeySecret: string;
Expiration: string;// ISO 8601 格式
SecurityToken: string;
userId: string;
}
export async function getStsToken() {
return fetcher<{
AccessKeyId: string;
AccessKeySecret: string;
Expiration: string;// ISO 8601 格式
SecurityToken: string;
userId: string;
}>('/api/oss/sts', { method: 'GET' });
return fetcher<StsToken>('/api/oss/sts', { method: 'GET' });
}