@@ -11,6 +11,8 @@ function LoginPageContent() {
1111 const [ lockoutUntil , setLockoutUntil ] = useState ( 0 ) ;
1212 const [ remainingAttempts , setRemainingAttempts ] = useState < number | null > ( null ) ;
1313 const [ totalAttempts , setTotalAttempts ] = useState ( 0 ) ;
14+ // 用于触发每秒重渲染
15+ const [ , setTick ] = useState ( 0 ) ;
1416 const router = useRouter ( ) ;
1517 const searchParams = useSearchParams ( ) ;
1618 const from = searchParams . get ( "from" ) || "/" ;
@@ -31,6 +33,8 @@ function LoginPageContent() {
3133 setLoading ( false ) ;
3234 setError ( "" ) ;
3335 }
36+ // 强制重渲染以更新倒计时显示
37+ setTick ( t => t + 1 ) ;
3438 } , 1000 ) ;
3539
3640 return ( ) => clearInterval ( timer ) ;
@@ -100,7 +104,7 @@ function LoginPageContent() {
100104 < div className = "w-16 h-16 bg-gradient-to-br from-blue-500 to-purple-600 rounded-2xl flex items-center justify-center mb-4 shadow-lg" >
101105 < LockKeyhole className = "w-8 h-8 text-white" />
102106 </ div >
103- < h1 className = "text-2xl font-bold text-slate-100" > CLIProxy Dashboard</ h1 >
107+ < h1 className = "text-2xl font-bold text-slate-100" > CLIProxyAPI Dashboard</ h1 >
104108 < p className = "text-slate-400 mt-2" > 请输入密码以继续</ p >
105109 </ div >
106110
@@ -122,23 +126,13 @@ function LoginPageContent() {
122126 />
123127 </ div >
124128
125- { error && (
129+ { error && ! isLocked && (
126130 < div className = { `rounded-lg p-3 text-sm ${
127131 isLocked
128132 ? "bg-red-500/10 border border-red-500/50 text-red-400"
129133 : "bg-orange-500/10 border border-orange-500/50 text-orange-400"
130134 } `} >
131135 < p className = "font-medium" > { error } </ p >
132- { remainingAttempts !== null && remainingAttempts > 0 && ! isLocked && (
133- < p className = "text-xs mt-1.5 opacity-80" >
134- 还剩 < span className = "font-semibold" > { remainingAttempts } </ span > 次尝试机会
135- </ p >
136- ) }
137- { totalAttempts > 0 && ! isLocked && (
138- < p className = "text-xs mt-1 opacity-70" >
139- 累计错误 { totalAttempts } 次
140- </ p >
141- ) }
142136 </ div >
143137 ) }
144138
0 commit comments