From b1cc9050ffc882fcbba243ae0de77d82181d63ee Mon Sep 17 00:00:00 2001 From: AAEE86 Date: Mon, 25 Aug 2025 15:20:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B7=BB=E5=8A=A0=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E9=80=9F=E7=8E=87=E9=99=90=E5=88=B6=E4=B8=AD=E9=97=B4=E4=BB=B6?= =?UTF-8?q?=EF=BC=8C=E4=BC=98=E5=8C=96=E9=AA=8C=E8=AF=81=E7=A0=81=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E6=A1=86=E4=BA=A4=E4=BA=92=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- router/api-router.go | 2 +- web/src/components/common/modals/TwoFactorAuthModal.jsx | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/router/api-router.go b/router/api-router.go index b3d4fe08e..f8d87d645 100644 --- a/router/api-router.go +++ b/router/api-router.go @@ -114,7 +114,7 @@ func SetApiRouter(router *gin.Engine) { channelRoute.GET("/models", controller.ChannelListModels) channelRoute.GET("/models_enabled", controller.EnabledListModels) channelRoute.GET("/:id", controller.GetChannel) - channelRoute.POST("/:id/key", controller.GetChannelKey) + channelRoute.POST("/:id/key", middleware.CriticalRateLimit(), controller.GetChannelKey) channelRoute.GET("/test", controller.TestAllChannels) channelRoute.GET("/test/:id", controller.TestChannel) channelRoute.GET("/update_balance", controller.UpdateAllChannelsBalance) diff --git a/web/src/components/common/modals/TwoFactorAuthModal.jsx b/web/src/components/common/modals/TwoFactorAuthModal.jsx index a3884d986..b22719682 100644 --- a/web/src/components/common/modals/TwoFactorAuthModal.jsx +++ b/web/src/components/common/modals/TwoFactorAuthModal.jsx @@ -47,8 +47,8 @@ const TwoFactorAuthModal = ({ }) => { const { t } = useTranslation(); - const handleKeyPress = (e) => { - if (e.key === 'Enter' && code) { + const handleKeyDown = (e) => { + if (e.key === 'Enter' && code && !loading) { onVerify(); } }; @@ -75,7 +75,7 @@ const TwoFactorAuthModal = ({