refactor: ♻️ eslint 代码规范调整

This commit is contained in:
ray
2024-10-13 10:42:48 +08:00
parent 72eb87d005
commit a4ef6eb696
66 changed files with 376 additions and 376 deletions

View File

@@ -1,17 +1,17 @@
import request from "@/utils/request";
class FileAPI {
const FileAPI = {
/**
* 文件上传地址
*/
static uploadUrl = import.meta.env.VITE_APP_BASE_API + "/api/v1/files";
uploadUrl: import.meta.env.VITE_APP_BASE_API + "/api/v1/files",
/**
* 上传文件
*
* @param file
*/
static upload(file: File) {
upload(file: File) {
const formData = new FormData();
formData.append("file", file);
return request<any, FileInfo>({
@@ -22,27 +22,27 @@ class FileAPI {
"Content-Type": "multipart/form-data",
},
});
}
},
/**
* 删除文件
*
* @param filePath 文件完整路径
*/
static deleteByPath(filePath?: string) {
deleteByPath(filePath?: string) {
return request({
url: "/api/v1/files",
method: "delete",
params: { filePath: filePath },
});
}
},
/**
* 下载文件
* @param url
* @param fileName
*/
static downloadFile(url: string, fileName?: string) {
downloadFile(url: string, fileName?: string) {
return request({
url: url,
method: "get",
@@ -56,8 +56,8 @@ class FileAPI {
a.click();
window.URL.revokeObjectURL(url);
});
}
}
},
};
export default FileAPI;