Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
Add UploadOss API
Browse files Browse the repository at this point in the history
  • Loading branch information
Jzow committed Oct 20, 2023
1 parent 96f2b12 commit 77b8945
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/api/basic/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {ContentTypeEnum} from "@/enums/httpEnum";
enum Api {
UploadXlsx = '/v2/common/upload/excel',
ExportXlsx = '/v2/common/export/excel',
UploadOss = '/v2/common/uploadOss',
}

export interface UploadFileParams {
Expand Down Expand Up @@ -40,4 +41,21 @@ export function exportXlsx(type: string, mode: ErrorMessageMode = 'notice') {
errorMessageMode: mode,
},
);
}

export function uploadOss(params: UploadFileParams, mode: ErrorMessageMode = 'notice') {
return defHttp.post<BaseResp>(
{
url: Api.UploadOss,
params,
headers: {
'Content-type': ContentTypeEnum.FORM_DATA,
// @ts-ignore
ignoreCancelToken: true,
},
},
{
errorMessageMode: mode,
},
);
}

0 comments on commit 77b8945

Please sign in to comment.