diff --git a/packages/napcat-webui-frontend/src/components/password_login.tsx b/packages/napcat-webui-frontend/src/components/password_login.tsx index 1f7d8223..e2a98932 100644 --- a/packages/napcat-webui-frontend/src/components/password_login.tsx +++ b/packages/napcat-webui-frontend/src/components/password_login.tsx @@ -6,6 +6,7 @@ import { Input } from '@heroui/input'; import { useState } from 'react'; import { toast } from 'react-hot-toast'; import { IoChevronDown } from 'react-icons/io5'; +import { Spinner } from '@heroui/spinner'; import type { QQItem } from '@/components/quick_login'; import { isQQQuickNewItem } from '@/utils/qq'; @@ -25,6 +26,7 @@ interface PasswordLoginProps { uin: string; password: string; } | null; + captchaVerifying?: boolean; newDeviceState?: { needNewDevice: boolean; jumpUrl: string; @@ -34,7 +36,7 @@ interface PasswordLoginProps { onNewDeviceCancel?: () => void; } -const PasswordLogin: React.FC = ({ onSubmit, onCaptchaSubmit, onNewDeviceVerified, isLoading, qqList, captchaState, newDeviceState, onCaptchaCancel, onNewDeviceCancel }) => { +const PasswordLogin: React.FC = ({ onSubmit, onCaptchaSubmit, onNewDeviceVerified, isLoading, qqList, captchaState, captchaVerifying, newDeviceState, onCaptchaCancel, onNewDeviceCancel }) => { const [uin, setUin] = useState(''); const [password, setPassword] = useState(''); @@ -54,14 +56,25 @@ const PasswordLogin: React.FC = ({ onSubmit, onCaptchaSubmit
{captchaState?.needCaptcha && captchaState.proofWaterUrl ? (
-

登录需要安全验证,请完成验证码

- { - onCaptchaSubmit?.(captchaState.uin, captchaState.password, data); - }} - onCancel={onCaptchaCancel} - /> + {captchaVerifying ? ( + <> +

验证码已提交,正在等待服务器验证结果...

+
+ +
+ + ) : ( + <> +

登录需要安全验证,请完成验证码

+ { + onCaptchaSubmit?.(captchaState.uin, captchaState.password, data); + }} + onCancel={onCaptchaCancel} + /> + + )}