From be6b58b0a1c511950733bf1fde63799208fdbe44 Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Mon, 15 Jan 2024 15:07:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20WebDav=20=E7=AB=AF=E5=8F=A3=E5=8E=BB?= =?UTF-8?q?=E6=8E=89=E5=BF=85=E5=A1=AB=E6=A0=A1=E9=AA=8C=20(#3617)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/utils/cloud_storage/client/webdav.go | 8 +++++-- .../setting/backup-account/webdav/index.vue | 24 ++++++++++++------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/backend/utils/cloud_storage/client/webdav.go b/backend/utils/cloud_storage/client/webdav.go index 7da3fe470..966fdc870 100644 --- a/backend/utils/cloud_storage/client/webdav.go +++ b/backend/utils/cloud_storage/client/webdav.go @@ -15,12 +15,16 @@ type webDAVClient struct { func NewWebDAVClient(vars map[string]interface{}) (*webDAVClient, error) { address := loadParamFromVars("address", true, vars) - port := loadParamFromVars("port", false, vars) + port := loadParamFromVars("port", true, vars) password := loadParamFromVars("password", true, vars) username := loadParamFromVars("username", true, vars) bucket := loadParamFromVars("bucket", true, vars) - client := gowebdav.NewClient(fmt.Sprintf("%s:%s", address, port), username, password) + url := fmt.Sprintf("%s:%s", address, port) + if len(port) == 0 { + url = address + } + client := gowebdav.NewClient(url, username, password) if err := client.Connect(); err != nil { return nil, err } diff --git a/frontend/src/views/setting/backup-account/webdav/index.vue b/frontend/src/views/setting/backup-account/webdav/index.vue index 01664cfb8..4e1857616 100644 --- a/frontend/src/views/setting/backup-account/webdav/index.vue +++ b/frontend/src/views/setting/backup-account/webdav/index.vue @@ -24,12 +24,8 @@ - - + +