上传api

This commit is contained in:
none 2023-03-03 09:58:42 +08:00
parent 83c12df6ab
commit 973d08b5dc
2 changed files with 17 additions and 0 deletions

View File

@ -7,3 +7,6 @@ export * as courseChapter from "./course-chapter";
export * as course from "./course";
export * as courseHour from "./course-hour";
export * as department from "./department";
export * as resourceCategory from "./resource-category";
export * as resource from "./resource";
export * as upload from "./upload";

14
src/api/upload.ts Normal file
View File

@ -0,0 +1,14 @@
import client from "./internal/httpClient";
export function image(categoryId: number, file: File) {
return client.post("/backend/v1/upload/image", {
category_id: categoryId,
file: file,
});
}
export function minioToken(extension: string) {
return client.get("/backend/v1/upload/minio-token", {
extension,
});
}