fix: 修复了一堆API错误,并顺手添加了OSS API
This commit is contained in:
@@ -48,4 +48,5 @@ export async function clientFetch<T = unknown>(
|
||||
export * as AuthAPI from './endpoints/auth.client'
|
||||
export * as UserAPI from './endpoints/user.client'
|
||||
export * as SmsAPI from './endpoints/sms.client'
|
||||
export * as AdminAPI from './endpoints/admin.client'
|
||||
export * as AdminAPI from './endpoints/admin.client'
|
||||
export * as OSSAPI from './endpoints/oss.client'
|
||||
13
apps/frontend/lib/api/endpoints/oss.client.ts
Normal file
13
apps/frontend/lib/api/endpoints/oss.client.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { clientFetch } from "../client";
|
||||
|
||||
export interface StsToken {
|
||||
AccessKeyId: string;
|
||||
AccessKeySecret: string;
|
||||
Expiration: string;// ISO 8601 格式
|
||||
SecurityToken: string;
|
||||
userId: string;
|
||||
}
|
||||
|
||||
export async function getStsToken() {
|
||||
return clientFetch<StsToken>('/api/oss/sts');
|
||||
}
|
||||
Reference in New Issue
Block a user