更新两步验证逻辑

This commit is contained in:
hanhh
2021-09-01 23:01:49 +08:00
parent 97baff8baf
commit 00cb915f48
3 changed files with 38 additions and 62 deletions
+1 -6
View File
@@ -23,7 +23,6 @@ const Login = () => {
const [waitTime, setWaitTime] = useState<any>();
const { theme } = useTheme();
const [twoFactor, setTwoFactor] = useState(false);
const [loginInfo, setLoginInfo] = useState<any>();
const [verifing, setVerifing] = useState(false);
const handleOk = (values: any) => {
@@ -39,10 +38,6 @@ const Login = () => {
})
.then((data) => {
if (data.code === 420) {
setLoginInfo({
username: values.username,
password: values.password,
});
setTwoFactor(true);
} else {
checkResponse(data);
@@ -59,7 +54,7 @@ const Login = () => {
setVerifing(true);
request
.put(`${config.apiPrefix}user/two-factor/login`, {
data: { ...loginInfo, code: values.code },
data: { code: values.code },
})
.then((data: any) => {
if (data.code === 430) {