Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
monorepo
/
venus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 6fbf1387
authored
May 25, 2025
by
Netfan
Committed by
GitHub
May 25, 2025
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: reset slider-captcha after login failed (#6275)
1 parent
e5c93739
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
playground/src/views/_core/authentication/login.vue
playground/src/views/_core/authentication/login.vue
View file @
6fbf138
...
@@ -111,10 +111,11 @@ const loginRef =
...
@@ -111,10 +111,11 @@ const loginRef =
async
function
onSubmit
(
params
:
Recordable
<
any
>
)
{
async
function
onSubmit
(
params
:
Recordable
<
any
>
)
{
authStore
.
authLogin
(
params
).
catch
(()
=>
{
authStore
.
authLogin
(
params
).
catch
(()
=>
{
// 登陆失败,刷新验证码的演示
// 登陆失败,刷新验证码的演示
const
formApi
=
loginRef
.
value
?.
getFormApi
();
// 重置验证码组件的值
formApi
?.
setFieldValue
(
'captcha'
,
false
,
false
);
// 使用表单API获取验证码组件实例,并调用其resume方法来重置验证码
// 使用表单API获取验证码组件实例,并调用其resume方法来重置验证码
loginRef
.
value
formApi
?.
getFormApi
()
?.
getFieldComponentRef
<
InstanceType
<
typeof
SliderCaptcha
>>
(
'captcha'
)
?.
getFieldComponentRef
<
InstanceType
<
typeof
SliderCaptcha
>>
(
'captcha'
)
?.
resume
();
?.
resume
();
});
});
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment