refactor: ♻️ 字典重构,系统权限模块优化

This commit is contained in:
hxr
2024-06-24 08:21:46 +08:00
parent 239989f4aa
commit d5dfcb978e
43 changed files with 1243 additions and 1821 deletions

View File

@@ -1,37 +0,0 @@
import request from "@/utils/request";
import { FileInfo } from "./model";
class FileAPI {
/**
* 上传文件
*
* @param file
*/
static upload(file: File) {
const formData = new FormData();
formData.append("file", file);
return request<any, FileInfo>({
url: "/api/v1/files",
method: "post",
data: formData,
headers: {
"Content-Type": "multipart/form-data",
},
});
}
/**
* 删除文件
*
* @param filePath 文件完整路径
*/
static deleteByPath(filePath?: string) {
return request({
url: "/api/v1/files",
method: "delete",
params: { filePath: filePath },
});
}
}
export default FileAPI;

View File

@@ -1,7 +0,0 @@
/**
* 文件API类型声明
*/
export interface FileInfo {
name: string;
url: string;
}