From 01f5c868b7cee4ed9507f48201ef3a70f47d0f2e Mon Sep 17 00:00:00 2001 From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com> Date: Wed, 8 Nov 2023 16:41:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=E7=BD=91=E7=AB=99?= =?UTF-8?q?=E5=9F=9F=E5=90=8D=E9=87=8D=E5=A4=8D=E7=AB=AF=E5=8F=A3=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E6=8F=90=E4=BA=A4=E7=9A=84=E9=97=AE=E9=A2=98=20(#2850?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/service/website_utils.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/app/service/website_utils.go b/backend/app/service/website_utils.go index 05e8bd726..ba421c25e 100644 --- a/backend/app/service/website_utils.go +++ b/backend/app/service/website_utils.go @@ -719,7 +719,6 @@ func getWebsiteDomains(domains string, defaultPort int, websiteID uint) (domainM } for port := range ports { - addPorts = append(addPorts, port) if existPorts, _ := websiteDomainRepo.GetBy(websiteDomainRepo.WithPort(port)); len(existPorts) == 0 { errMap := make(map[string]interface{}) errMap["port"] = port @@ -742,6 +741,9 @@ func getWebsiteDomains(domains string, defaultPort int, websiteID uint) (domainM return } } + if existPorts, _ := websiteDomainRepo.GetBy(websiteDomainRepo.WithWebsiteId(websiteID), websiteDomainRepo.WithPort(port)); len(existPorts) == 0 { + addPorts = append(addPorts, port) + } } return