feat: upgrade frontend

This commit is contained in:
naiba
2024-12-25 21:02:54 +08:00
parent 7d15838548
commit 87e01a532e
5 changed files with 9 additions and 9 deletions

View File

@@ -101,8 +101,8 @@ func authenticator() func(c *gin.Context) (interface{}, error) {
return nil, jwt.ErrFailedAuthentication
}
model.ClearIP(singleton.DB, realip, model.BlockIDUnknownUser)
model.ClearIP(singleton.DB, realip, int64(user.ID))
model.UnblockIP(singleton.DB, realip, model.BlockIDUnknownUser)
model.UnblockIP(singleton.DB, realip, int64(user.ID))
return utils.Itoa(user.ID), nil
}
}
@@ -172,7 +172,7 @@ func optionalAuthMiddleware(mw *jwt.GinJWTMiddleware) func(c *gin.Context) {
identity := mw.IdentityHandler(c)
if identity != nil {
model.ClearIP(singleton.DB, c.GetString(model.CtxKeyRealIPStr), model.BlockIDToken)
model.UnblockIP(singleton.DB, c.GetString(model.CtxKeyRealIPStr), model.BlockIDToken)
c.Set(mw.IdentityKey, identity)
} else {
if err := model.BlockIP(singleton.DB, c.GetString(model.CtxKeyRealIPStr), model.WAFBlockReasonTypeBruteForceToken, model.BlockIDToken); err != nil {

View File

@@ -69,7 +69,7 @@ func batchDeleteBlockedAddress(c *gin.Context) (any, error) {
return nil, err
}
if err := model.BatchClearIP(singleton.DB, utils.Unique(list)); err != nil {
if err := model.BatchUnblockIP(singleton.DB, utils.Unique(list)); err != nil {
return nil, newGormError("%v", err)
}