mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-26 00:46:07 +08:00
两步验证输入框自动聚焦
This commit is contained in:
parent
20893698ba
commit
10c07b0a09
|
@ -23,7 +23,7 @@ const Login = () => {
|
||||||
const [waitTime, setWaitTime] = useState<any>();
|
const [waitTime, setWaitTime] = useState<any>();
|
||||||
const { theme } = useTheme();
|
const { theme } = useTheme();
|
||||||
const [twoFactor, setTwoFactor] = useState(false);
|
const [twoFactor, setTwoFactor] = useState(false);
|
||||||
const [verifing, setVerifing] = useState(false);
|
const [verifying, setVerifying] = useState(false);
|
||||||
const [loginInfo, setLoginInfo] = useState<any>();
|
const [loginInfo, setLoginInfo] = useState<any>();
|
||||||
|
|
||||||
const handleOk = (values: any) => {
|
const handleOk = (values: any) => {
|
||||||
|
@ -56,7 +56,7 @@ const Login = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const completeTowFactor = (values: any) => {
|
const completeTowFactor = (values: any) => {
|
||||||
setVerifing(true);
|
setVerifying(true);
|
||||||
request
|
request
|
||||||
.put(`${config.apiPrefix}user/two-factor/login`, {
|
.put(`${config.apiPrefix}user/two-factor/login`, {
|
||||||
data: { ...loginInfo, code: values.code },
|
data: { ...loginInfo, code: values.code },
|
||||||
|
@ -67,11 +67,11 @@ const Login = () => {
|
||||||
} else {
|
} else {
|
||||||
checkResponse(data);
|
checkResponse(data);
|
||||||
}
|
}
|
||||||
setVerifing(false);
|
setVerifying(false);
|
||||||
})
|
})
|
||||||
.catch((error: any) => {
|
.catch((error: any) => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
setVerifing(false);
|
setVerifying(false);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -145,13 +145,13 @@ const Login = () => {
|
||||||
]}
|
]}
|
||||||
hasFeedback
|
hasFeedback
|
||||||
>
|
>
|
||||||
<Input placeholder="6位数字" autoComplete="off" />
|
<Input placeholder="6位数字" autoFocus autoComplete="off" />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
htmlType="submit"
|
htmlType="submit"
|
||||||
style={{ width: '100%' }}
|
style={{ width: '100%' }}
|
||||||
loading={verifing}
|
loading={verifying}
|
||||||
>
|
>
|
||||||
验证
|
验证
|
||||||
</Button>
|
</Button>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user