From 7c7d30376f60c1b323d7dd21def2768fab1f6218 Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Thu, 27 Jun 2024 12:14:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E5=8A=A0=E5=AF=86?= =?UTF-8?q?=E5=8E=8B=E7=BC=A9=E6=96=87=E4=BB=B6=E8=A7=A3=E5=8E=8B=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98=20(#5580)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/file.go | 3 +++ frontend/src/views/host/file-management/decompress/index.vue | 2 +- go.sum | 2 -- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/app/service/file.go b/backend/app/service/file.go index 9252c4566..a73877b49 100644 --- a/backend/app/service/file.go +++ b/backend/app/service/file.go @@ -224,6 +224,9 @@ func (f *FileService) Compress(c request.FileCompress) error { func (f *FileService) DeCompress(c request.FileDeCompress) error { fo := files.NewFileOp() + if c.Type == "tar" && len(c.Secret) != 0 { + c.Type = "tar.gz" + } return fo.Decompress(c.Path, c.Dst, files.CompressType(c.Type), c.Secret) } diff --git a/frontend/src/views/host/file-management/decompress/index.vue b/frontend/src/views/host/file-management/decompress/index.vue index 23ae24ab2..2a921beb0 100644 --- a/frontend/src/views/host/file-management/decompress/index.vue +++ b/frontend/src/views/host/file-management/decompress/index.vue @@ -71,7 +71,7 @@ const rules = reactive({ const fileForm = ref(); let loading = ref(false); -let form = ref({ type: 'zip', dst: '', path: '' }); +let form = ref({ type: 'zip', dst: '', path: '', secret: '' }); let open = ref(false); let name = ref(''); diff --git a/go.sum b/go.sum index e3193666b..789b464d8 100644 --- a/go.sum +++ b/go.sum @@ -898,8 +898,6 @@ golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86h golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.13.0/go.mod h1:6mmbMOeV28HuMTgA6OSRkdXKYw/t5W9Uwn2Yv1r3Yxk= -golang.org/x/image v0.15.0 h1:kOELfmgrmJlw4Cdb7g/QGuB3CvDrXbqEIww/pNtNBm8= -golang.org/x/image v0.15.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE= golang.org/x/image v0.18.0 h1:jGzIakQa/ZXI1I0Fxvaa9W7yP25TqT6cHIHn+6CqvSQ= golang.org/x/image v0.18.0/go.mod h1:4yyo5vMFQjVjUcVk4jEQcU9MGy/rulF5WvUILseCM2E= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=