瀏覽代碼

fix(user):"Attempts" create and update to 2

caisi35 6 月之前
父節點
當前提交
8ffe29de78
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      internal/user/login.go

+ 1 - 0
internal/user/login.go

@@ -42,6 +42,7 @@ func BanIP(ip string) {
 			Attempts:  1,
 			Attempts:  1,
 			ExpiredAt: time.Now().Unix() + int64(settings.AuthSettings.BanThresholdMinutes*60),
 			ExpiredAt: time.Now().Unix() + int64(settings.AuthSettings.BanThresholdMinutes*60),
 		})
 		})
+		return
 	}
 	}
 	_, _ = b.Where(b.IP.Eq(ip)).UpdateSimple(b.Attempts.Add(1))
 	_, _ = b.Where(b.IP.Eq(ip)).UpdateSimple(b.Attempts.Add(1))
 }
 }