Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6579d71f
authored
Aug 25, 2025
by
AAEE86
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 添加接口速率限制中间件,优化验证码输入框交互体验
parent
6033d431
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
router/api-router.go
+1
-1
web/src/components/common/modals/TwoFactorAuthModal.jsx
+5
-4
No files found.
router/api-router.go
View file @
6579d71f
...
...
@@ -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
)
...
...
web/src/components/common/modals/TwoFactorAuthModal.jsx
View file @
6579d71f
...
...
@@ -47,8 +47,8 @@ const TwoFactorAuthModal = ({
})
=>
{
const
{
t
}
=
useTranslation
();
const
handleKey
Press
=
(
e
)
=>
{
if
(
e
.
key
===
'Enter'
&&
code
)
{
const
handleKey
Down
=
(
e
)
=>
{
if
(
e
.
key
===
'Enter'
&&
code
&&
!
loading
)
{
onVerify
();
}
};
...
...
@@ -75,7 +75,7 @@ const TwoFactorAuthModal = ({
<
Button
type=
"primary"
loading=
{
loading
}
disabled=
{
!
code
}
disabled=
{
!
code
||
loading
}
onClick=
{
onVerify
}
>
{
t
(
'验证'
)
}
...
...
@@ -114,7 +114,8 @@ const TwoFactorAuthModal = ({
onChange=
{
onCodeChange
}
size=
"large"
maxLength=
{
8
}
onKeyPress=
{
handleKeyPress
}
onKeyDown=
{
handleKeyDown
}
autoFocus
/>
<
Typography
.
Text
type=
"tertiary"
size=
"small"
className=
"mt-2 block"
>
{
t
(
'支持6位TOTP验证码或8位备用码'
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment