Netfan
9 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
4 additions and
3 deletions
-
playground/src/views/_core/authentication/login.vue
|
|
|
@ -111,10 +111,11 @@ const loginRef = |
|
|
|
async function onSubmit(params: Recordable<any>) { |
|
|
|
authStore.authLogin(params).catch(() => { |
|
|
|
// 登陆失败,刷新验证码的演示 |
|
|
|
|
|
|
|
const formApi = loginRef.value?.getFormApi(); |
|
|
|
// 重置验证码组件的值 |
|
|
|
formApi?.setFieldValue('captcha', false, false); |
|
|
|
// 使用表单API获取验证码组件实例,并调用其resume方法来重置验证码 |
|
|
|
loginRef.value |
|
|
|
?.getFormApi() |
|
|
|
formApi |
|
|
|
?.getFieldComponentRef<InstanceType<typeof SliderCaptcha>>('captcha') |
|
|
|
?.resume(); |
|
|
|
}); |
|
|
|
|