diff --git a/src/api/system/file.ts b/src/api/system/file.ts index a991ed74..ec58138f 100644 --- a/src/api/system/file.ts +++ b/src/api/system/file.ts @@ -1,5 +1,29 @@ import request from '@/utils/request' +/** + * 上传文件 + * + * @param file + */ +export function uploadFile(file: any) { + let formData = new FormData() + formData.append('file', file) + return request( + { + url: '/youlai-admin/api/v1/files', + method: 'post', + data: formData, + headers: { + 'Content-Type': 'multipart/form-data' + }, + }) +} + +/** + * 删除文件 + * + * @param path + */ export function deleteFile(path: string) { return request({ url: '/youlai-admin/api/v1/files',