refactor: 项目简化

Former-commit-id: 73a4a6c9c41e013928e6205dd7c078d0e955f487
This commit is contained in:
horizons
2022-09-13 07:44:55 +08:00
parent 90c6059f3f
commit 81d7880ebc
64 changed files with 204 additions and 5279 deletions

32
src/api/file.ts Normal file
View File

@@ -0,0 +1,32 @@
import request from '@/utils/request';
/**
* 上传文件
*
* @param file
*/
export function uploadFile(file: File) {
const formData = new FormData();
formData.append('file', file);
return request({
url: '/youlai-system/api/v1/files',
method: 'post',
data: formData,
headers: {
'Content-Type': 'multipart/form-data'
}
});
}
/**
* 删除文件
*
* @param path
*/
export function deleteFile(path?: string) {
return request({
url: '/youlai-system/api/v1/files',
method: 'delete',
params: { path: path }
});
}