From dbeaaa49f3179ac211c406102d9b2c182fbb3b31 Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Sun, 25 Jun 2023 11:50:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E6=97=A0=E6=B3=95=E6=AD=A3=E5=B8=B8=E8=AE=BF=E9=97=AE?= =?UTF-8?q?=E6=83=85=E5=86=B5=E4=B8=8B=E7=B3=BB=E7=BB=9F=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=20(#1438)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/middleware/bind_domain.go | 2 +- backend/middleware/ip_limit.go | 2 +- backend/middleware/password_expired.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/middleware/bind_domain.go b/backend/middleware/bind_domain.go index 601fc9f077aa..bf32af046bb5 100644 --- a/backend/middleware/bind_domain.go +++ b/backend/middleware/bind_domain.go @@ -15,7 +15,7 @@ func BindDomain() gin.HandlerFunc { settingRepo := repo.NewISettingRepo() status, err := settingRepo.Get(settingRepo.WithByKey("BindDomain")) if err != nil { - helper.ErrorWithDetail(c, constant.CodeErrDomain, constant.ErrTypeInternalServer, err) + helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err) return } if len(status.Value) == 0 { diff --git a/backend/middleware/ip_limit.go b/backend/middleware/ip_limit.go index 2fd890a0af96..dcfda7405f1f 100644 --- a/backend/middleware/ip_limit.go +++ b/backend/middleware/ip_limit.go @@ -15,7 +15,7 @@ func WhiteAllow() gin.HandlerFunc { settingRepo := repo.NewISettingRepo() status, err := settingRepo.Get(settingRepo.WithByKey("AllowIPs")) if err != nil { - helper.ErrorWithDetail(c, constant.CodeErrIP, constant.ErrTypeInternalServer, err) + helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err) return } diff --git a/backend/middleware/password_expired.go b/backend/middleware/password_expired.go index e1ed9e9faad1..9a6753014815 100644 --- a/backend/middleware/password_expired.go +++ b/backend/middleware/password_expired.go @@ -16,7 +16,7 @@ func PasswordExpired() gin.HandlerFunc { settingRepo := repo.NewISettingRepo() setting, err := settingRepo.Get(settingRepo.WithByKey("ExpirationDays")) if err != nil { - helper.ErrorWithDetail(c, constant.CodePasswordExpired, constant.ErrTypePasswordExpired, err) + helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypePasswordExpired, err) return } expiredDays, _ := strconv.Atoi(setting.Value) @@ -27,7 +27,7 @@ func PasswordExpired() gin.HandlerFunc { extime, err := settingRepo.Get(settingRepo.WithByKey("ExpirationTime")) if err != nil { - helper.ErrorWithDetail(c, constant.CodePasswordExpired, constant.ErrTypePasswordExpired, err) + helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypePasswordExpired, err) return } loc, _ := time.LoadLocation(common.LoadTimeZone())