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 > - +