fix: 取消接口限流
This commit is contained in:
@@ -15,11 +15,11 @@ func Setup(router *gin.Engine) {
|
|||||||
// 路由主页
|
// 路由主页
|
||||||
indexGroup := router.Group("/")
|
indexGroup := router.Group("/")
|
||||||
indexGroup.GET("",
|
indexGroup.GET("",
|
||||||
middleware.RateLimit(middleware.LimitOption{
|
// middleware.RateLimit(middleware.LimitOption{
|
||||||
Time: 300,
|
// Time: 300,
|
||||||
Count: 10,
|
// Count: 10,
|
||||||
Type: middleware.LIMIT_IP,
|
// Type: middleware.LIMIT_IP,
|
||||||
}),
|
// }),
|
||||||
controller.NewIndex.Handler,
|
controller.NewIndex.Handler,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -28,32 +28,32 @@ func Setup(router *gin.Engine) {
|
|||||||
|
|
||||||
// 验证码操作处理
|
// 验证码操作处理
|
||||||
indexGroup.GET("/captchaImage",
|
indexGroup.GET("/captchaImage",
|
||||||
middleware.RateLimit(middleware.LimitOption{
|
// middleware.RateLimit(middleware.LimitOption{
|
||||||
Time: 300,
|
// Time: 300,
|
||||||
Count: 60,
|
// Count: 60,
|
||||||
Type: middleware.LIMIT_IP,
|
// Type: middleware.LIMIT_IP,
|
||||||
}),
|
// }),
|
||||||
controller.NewCaptcha.Image,
|
controller.NewCaptcha.Image,
|
||||||
)
|
)
|
||||||
|
|
||||||
// 账号身份操作处理
|
// 账号身份操作处理
|
||||||
{
|
{
|
||||||
indexGroup.POST("/login",
|
indexGroup.POST("/login",
|
||||||
middleware.RateLimit(middleware.LimitOption{
|
// middleware.RateLimit(middleware.LimitOption{
|
||||||
Time: 300,
|
// Time: 300,
|
||||||
Count: 10,
|
// Count: 10,
|
||||||
Type: middleware.LIMIT_IP,
|
// Type: middleware.LIMIT_IP,
|
||||||
}),
|
// }),
|
||||||
controller.NewAccount.Login,
|
controller.NewAccount.Login,
|
||||||
)
|
)
|
||||||
indexGroup.GET("/getInfo", middleware.PreAuthorize(nil), controller.NewAccount.Info)
|
indexGroup.GET("/getInfo", middleware.PreAuthorize(nil), controller.NewAccount.Info)
|
||||||
indexGroup.GET("/getRouters", middleware.PreAuthorize(nil), controller.NewAccount.Router)
|
indexGroup.GET("/getRouters", middleware.PreAuthorize(nil), controller.NewAccount.Router)
|
||||||
indexGroup.POST("/logout",
|
indexGroup.POST("/logout",
|
||||||
middleware.RateLimit(middleware.LimitOption{
|
// middleware.RateLimit(middleware.LimitOption{
|
||||||
Time: 300,
|
// Time: 300,
|
||||||
Count: 5,
|
// Count: 5,
|
||||||
Type: middleware.LIMIT_IP,
|
// Type: middleware.LIMIT_IP,
|
||||||
}),
|
// }),
|
||||||
controller.NewAccount.Logout,
|
controller.NewAccount.Logout,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -61,11 +61,11 @@ func Setup(router *gin.Engine) {
|
|||||||
// 账号注册操作处理
|
// 账号注册操作处理
|
||||||
{
|
{
|
||||||
indexGroup.POST("/register",
|
indexGroup.POST("/register",
|
||||||
middleware.RateLimit(middleware.LimitOption{
|
// middleware.RateLimit(middleware.LimitOption{
|
||||||
Time: 300,
|
// Time: 300,
|
||||||
Count: 10,
|
// Count: 10,
|
||||||
Type: middleware.LIMIT_IP,
|
// Type: middleware.LIMIT_IP,
|
||||||
}),
|
// }),
|
||||||
controller.NewRegister.Register,
|
controller.NewRegister.Register,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user