Skip to content

Commit

Permalink
fix: 修改数据库无法正常访问情况下系统提示信息 (#1438)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssongliu authored Jun 25, 2023
1 parent 7546391 commit dbeaaa4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion backend/middleware/bind_domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion backend/middleware/ip_limit.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
4 changes: 2 additions & 2 deletions backend/middleware/password_expired.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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())
Expand Down

0 comments on commit dbeaaa4

Please # to comment.