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=