mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 13:47:15 +08:00
feat: 规范压缩解压
This commit is contained in:
@@ -45,8 +45,8 @@ export default {
|
||||
group: string
|
||||
): Promise<AxiosResponse<any>> => request.post('/file/permission', { path, mode, owner, group }),
|
||||
// 压缩文件
|
||||
compress: (paths: string[], file: string): Promise<AxiosResponse<any>> =>
|
||||
request.post('/file/compress', { paths, file }),
|
||||
compress: (dir: string, paths: string[], file: string): Promise<AxiosResponse<any>> =>
|
||||
request.post('/file/compress', { dir, paths, file }),
|
||||
// 解压文件
|
||||
unCompress: (file: string, path: string): Promise<AxiosResponse<any>> =>
|
||||
request.post('/file/unCompress', { file, path }),
|
||||
|
||||
@@ -30,8 +30,9 @@ const handleArchive = async () => {
|
||||
const message = window.$message.loading('正在压缩中...', {
|
||||
duration: 0
|
||||
})
|
||||
const paths = selected.value.map((item) => item.replace(path.value, '').replace(/^\//, ''))
|
||||
await api
|
||||
.compress(selected.value, file.value)
|
||||
.compress(path.value, paths, file.value)
|
||||
.then(() => {
|
||||
window.$message.success('压缩成功')
|
||||
show.value = false
|
||||
|
||||
Reference in New Issue
Block a user