mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-19 06:32:59 +08:00
fix: mfa 标题增加校验规则 (#2497)
This commit is contained in:
parent
1827fb3f46
commit
153fe5c1db
@ -114,6 +114,7 @@ const form = reactive({
|
||||
|
||||
const rules = reactive({
|
||||
code: [Rules.requiredInput],
|
||||
title: [Rules.simpleName],
|
||||
interval: [Rules.number, checkNumberRange(15, 60)],
|
||||
});
|
||||
|
||||
@ -138,11 +139,10 @@ const onCopy = async () => {
|
||||
|
||||
const loadMfaCodeBefore = async (formEl: FormInstance | undefined) => {
|
||||
if (!formEl) return;
|
||||
const result = await formEl.validateField('interval', callback);
|
||||
if (!result) {
|
||||
return;
|
||||
}
|
||||
loadMfaCode();
|
||||
formEl.validate(async (valid) => {
|
||||
if (!valid) return;
|
||||
loadMfaCode();
|
||||
});
|
||||
};
|
||||
const loadMfaCode = async () => {
|
||||
let param = {
|
||||
@ -154,14 +154,6 @@ const loadMfaCode = async () => {
|
||||
qrImage.value = res.data.qrImage;
|
||||
};
|
||||
|
||||
function callback(error: any) {
|
||||
if (error) {
|
||||
return error.message;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const onBind = async (formEl: FormInstance | undefined) => {
|
||||
if (!formEl) return;
|
||||
formEl.validate(async (valid) => {
|
||||
|
Loading…
Reference in New Issue
Block a user