From 2541a38b1301aba1480e9caad2d6cc5a3bd8c4dd Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Tue, 31 Oct 2023 18:29:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8F=96=E6=B6=88=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E9=99=90=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/common/common.go | 50 ++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/modules/common/common.go b/src/modules/common/common.go index ffdec896..d5d53eb5 100644 --- a/src/modules/common/common.go +++ b/src/modules/common/common.go @@ -15,11 +15,11 @@ func Setup(router *gin.Engine) { // 路由主页 indexGroup := router.Group("/") indexGroup.GET("", - middleware.RateLimit(middleware.LimitOption{ - Time: 300, - Count: 10, - Type: middleware.LIMIT_IP, - }), + // middleware.RateLimit(middleware.LimitOption{ + // Time: 300, + // Count: 10, + // Type: middleware.LIMIT_IP, + // }), controller.NewIndex.Handler, ) @@ -28,32 +28,32 @@ func Setup(router *gin.Engine) { // 验证码操作处理 indexGroup.GET("/captchaImage", - middleware.RateLimit(middleware.LimitOption{ - Time: 300, - Count: 60, - Type: middleware.LIMIT_IP, - }), + // middleware.RateLimit(middleware.LimitOption{ + // Time: 300, + // Count: 60, + // Type: middleware.LIMIT_IP, + // }), controller.NewCaptcha.Image, ) // 账号身份操作处理 { indexGroup.POST("/login", - middleware.RateLimit(middleware.LimitOption{ - Time: 300, - Count: 10, - Type: middleware.LIMIT_IP, - }), + // middleware.RateLimit(middleware.LimitOption{ + // Time: 300, + // Count: 10, + // Type: middleware.LIMIT_IP, + // }), controller.NewAccount.Login, ) indexGroup.GET("/getInfo", middleware.PreAuthorize(nil), controller.NewAccount.Info) indexGroup.GET("/getRouters", middleware.PreAuthorize(nil), controller.NewAccount.Router) indexGroup.POST("/logout", - middleware.RateLimit(middleware.LimitOption{ - Time: 300, - Count: 5, - Type: middleware.LIMIT_IP, - }), + // middleware.RateLimit(middleware.LimitOption{ + // Time: 300, + // Count: 5, + // Type: middleware.LIMIT_IP, + // }), controller.NewAccount.Logout, ) } @@ -61,11 +61,11 @@ func Setup(router *gin.Engine) { // 账号注册操作处理 { indexGroup.POST("/register", - middleware.RateLimit(middleware.LimitOption{ - Time: 300, - Count: 10, - Type: middleware.LIMIT_IP, - }), + // middleware.RateLimit(middleware.LimitOption{ + // Time: 300, + // Count: 10, + // Type: middleware.LIMIT_IP, + // }), controller.NewRegister.Register, ) }