mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-31 22:18:07 +08:00
parent
8bb07cf4f5
commit
581ed16b73
@ -9,6 +9,7 @@
|
|||||||
size="default"
|
size="default"
|
||||||
:placeholder="$t('commons.login.mfaCode')"
|
:placeholder="$t('commons.login.mfaCode')"
|
||||||
v-model.trim="mfaLoginForm.code"
|
v-model.trim="mfaLoginForm.code"
|
||||||
|
@input="mfaLogin(true)"
|
||||||
>
|
>
|
||||||
<template #prefix>
|
<template #prefix>
|
||||||
<el-icon class="el-input__icon">
|
<el-icon class="el-input__icon">
|
||||||
@ -28,7 +29,7 @@
|
|||||||
type="primary"
|
type="primary"
|
||||||
size="default"
|
size="default"
|
||||||
round
|
round
|
||||||
@click="mfaLogin()"
|
@click="mfaLogin(false)"
|
||||||
>
|
>
|
||||||
{{ $t('commons.button.verify') }}
|
{{ $t('commons.button.verify') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -278,8 +279,8 @@ const login = (formEl: FormInstance | undefined) => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const mfaLogin = async () => {
|
const mfaLogin = async (auto: boolean) => {
|
||||||
if (mfaLoginForm.code) {
|
if ((!auto && mfaLoginForm.code) || (auto && mfaLoginForm.code.length === 6)) {
|
||||||
mfaLoginForm.name = loginForm.name;
|
mfaLoginForm.name = loginForm.name;
|
||||||
mfaLoginForm.password = loginForm.password;
|
mfaLoginForm.password = loginForm.password;
|
||||||
const res = await mfaLoginApi(mfaLoginForm);
|
const res = await mfaLoginApi(mfaLoginForm);
|
||||||
@ -328,7 +329,7 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mfaShow.value && !mfaButtonFocused.value) {
|
if (mfaShow.value && !mfaButtonFocused.value) {
|
||||||
mfaLogin();
|
mfaLogin(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user