diff --git a/src/components/Login/LoginForm.tsx b/src/components/Login/LoginForm.tsx index d6d169a..08f234a 100644 --- a/src/components/Login/LoginForm.tsx +++ b/src/components/Login/LoginForm.tsx @@ -8,9 +8,8 @@ import { useShallow } from 'zustand/react/shallow'; import { Button } from '@/components'; import { useLogin, useLoginRedirect } from '@/hooks'; -import { apiSendSMS, apiUserLogin } from '@/services'; +import { apiSendSMS } from '@/services'; import { useUserStore } from '@/store'; -import { setAccessToken } from '@/utils'; export default function LoginForm({ className }: { className?: string }) { const redirect = useLoginRedirect(); @@ -24,8 +23,8 @@ export default function LoginForm({ className }: { className?: string }) { })), ); - const [phone, setPhone] = useState('18812345678'); // 手机号 - const [authCode, setAuthCode] = useState('123456'); // 验证码 + const [phone, setPhone] = useState(''); // 手机号 + const [authCode, setAuthCode] = useState(''); // 验证码 const [errorText, setErrorText] = useState(''); // 验证码 const [buttonText, setButtonText] = useState('获取验证码'); // 获取验证码 按钮文案 const [time, setTime] = useState(0); // 倒计时 @@ -38,7 +37,7 @@ export default function LoginForm({ className }: { className?: string }) { setBtnLoading(true); // 设置倒计时 - const gapTime: number = 14; + const gapTime: number = 59; setTime(gapTime); const timer = setTimeout(() => { setBtnLoading(false); @@ -69,7 +68,7 @@ export default function LoginForm({ className }: { className?: string }) { if (result.code === 200) { setShowLogin(false); await getUserInfo(); - // router.replace(redirect); + router.replace(redirect); } else { setErrorText(result.message); setBtnLoading(false);