2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-06 20:03:13 +08:00

feat: 文件操作支持覆盖

This commit is contained in:
耗子
2024-10-27 01:00:02 +08:00
parent 42dd00c5ea
commit 658b6a79eb
4 changed files with 200 additions and 24 deletions

View File

@@ -1,6 +1,7 @@
import type { AxiosResponse } from 'axios'
import { request } from '@/utils'
import type { RequestConfig } from '~/types/axios'
export default {
// 创建文件/文件夹
@@ -25,11 +26,11 @@ export default {
})
},
// 移动文件
move: (source: string, target: string): Promise<AxiosResponse<any>> =>
request.post('/file/move', { source, target }),
move: (source: string, target: string, force: boolean): Promise<AxiosResponse<any>> =>
request.post('/file/move', { source, target, force }, { noNeedTip: true } as RequestConfig),
// 复制文件
copy: (source: string, target: string): Promise<AxiosResponse<any>> =>
request.post('/file/copy', { source, target }),
copy: (source: string, target: string, force: boolean): Promise<AxiosResponse<any>> =>
request.post('/file/copy', { source, target, force }, { noNeedTip: true } as RequestConfig),
// 远程下载
remoteDownload: (path: string, url: string): Promise<AxiosResponse<any>> =>
request.post('/file/remoteDownload', { path, url }),