Skip to content

Commit dbeaaa4

Browse files
authored
fix: 修改数据库无法正常访问情况下系统提示信息 (#1438)
1 parent 7546391 commit dbeaaa4

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

backend/middleware/bind_domain.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func BindDomain() gin.HandlerFunc {
1515
settingRepo := repo.NewISettingRepo()
1616
status, err := settingRepo.Get(settingRepo.WithByKey("BindDomain"))
1717
if err != nil {
18-
helper.ErrorWithDetail(c, constant.CodeErrDomain, constant.ErrTypeInternalServer, err)
18+
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
1919
return
2020
}
2121
if len(status.Value) == 0 {

backend/middleware/ip_limit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func WhiteAllow() gin.HandlerFunc {
1515
settingRepo := repo.NewISettingRepo()
1616
status, err := settingRepo.Get(settingRepo.WithByKey("AllowIPs"))
1717
if err != nil {
18-
helper.ErrorWithDetail(c, constant.CodeErrIP, constant.ErrTypeInternalServer, err)
18+
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
1919
return
2020
}
2121

backend/middleware/password_expired.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func PasswordExpired() gin.HandlerFunc {
1616
settingRepo := repo.NewISettingRepo()
1717
setting, err := settingRepo.Get(settingRepo.WithByKey("ExpirationDays"))
1818
if err != nil {
19-
helper.ErrorWithDetail(c, constant.CodePasswordExpired, constant.ErrTypePasswordExpired, err)
19+
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypePasswordExpired, err)
2020
return
2121
}
2222
expiredDays, _ := strconv.Atoi(setting.Value)
@@ -27,7 +27,7 @@ func PasswordExpired() gin.HandlerFunc {
2727

2828
extime, err := settingRepo.Get(settingRepo.WithByKey("ExpirationTime"))
2929
if err != nil {
30-
helper.ErrorWithDetail(c, constant.CodePasswordExpired, constant.ErrTypePasswordExpired, err)
30+
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypePasswordExpired, err)
3131
return
3232
}
3333
loc, _ := time.LoadLocation(common.LoadTimeZone())

0 commit comments

Comments
 (0)