feat: 文件管理

This commit is contained in:
bietiaop
2025-02-02 11:37:58 +08:00
parent 9257606f1c
commit ee7275f482
8 changed files with 653 additions and 377 deletions

View File

@@ -15,6 +15,14 @@ export default class FileManager {
return data.data
}
// 新增:按目录获取
public static async listDirectories(path: string = '/') {
const { data } = await serverRequest.get<ServerResponse<FileInfo[]>>(
`/File/list?path=${encodeURIComponent(path)}&onlyDirectory=true`
)
return data.data
}
public static async createDirectory(path: string): Promise<boolean> {
const { data } = await serverRequest.post<ServerResponse<boolean>>(
'/File/mkdir',