From fa6dec969ffcefb98481f06838d45afaf1061509 Mon Sep 17 00:00:00 2001 From: whyour Date: Sat, 25 Dec 2021 20:09:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=A4=E6=AD=A5=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E7=95=8C=E9=9D=A2=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/login/index.tsx | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/pages/login/index.tsx b/src/pages/login/index.tsx index ec1d1d8c..088b537e 100644 --- a/src/pages/login/index.tsx +++ b/src/pages/login/index.tsx @@ -113,6 +113,14 @@ const Login = () => { } }; + const codeInputChange = (e: React.ChangeEvent) => { + const { value } = e.target as any; + const regx = /^[0-9]{6}$/; + if (regx.test(value)) { + completeTowFactor({ code: value }); + } + }; + useEffect(() => { const isAuth = localStorage.getItem(config.authKey); if (isAuth) { @@ -144,12 +152,15 @@ const Login = () => { { pattern: /^[0-9]{6}$/, message: '验证码为6位数字', - validateTrigger: 'onBlur', }, ]} - hasFeedback > - +