Skip to content

Bug: 滑动验证重置后 表单校验未重置 #6202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
5 tasks done
qw81641493 opened this issue May 15, 2025 · 2 comments
Open
5 tasks done

Bug: 滑动验证重置后 表单校验未重置 #6202

qw81641493 opened this issue May 15, 2025 · 2 comments

Comments

@qw81641493
Copy link

Version

Vben Admin V5

Describe the bug?

滑动验证重置后 表单校验未重置 重现步骤如下
登录界面 输入错误用户名或密码 滑动验证组件验证成功 点击登录 提示失败 滑动验证重置 此时可以直接点击登录按钮 滑动验证组件不会重新校验

Reproduction

https://www.vben.pro/#/auth/login

System Info

windows edge

Relevant log output

Validations

@qw81641493
Copy link
Author

应该同步 重置表单校验

@qw81641493
Copy link
Author

async function onSubmit(params: Recordable) {
authStore.authLogin(params).catch(() => {
// 登陆失败,刷新验证码的演示
// 使用表单API获取验证码组件实例,并调用其resume方法来重置验证码
loginRef.value
?.getFormApi()
?.getFieldComponentRef<InstanceType>('captcha')
?.resume();
loginRef.value?.getFormApi()?.setValues({ captcha: false });
});
}
添加 loginRef.value?.getFormApi()?.setValues({ captcha: false }); 这段代码即可修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant