Commit c26406853faedcf09d59b8224d4e69162eaca7c5
1 parent
e07bc3d9
fix: DEFECT-1547 租户首次登录的时候,新密码和确认密码输入一致,然后确认密码修改,提示两次密码输入不一样,然后再把新密码改为跟确认密码一致后,还是提示此信息
Showing
1 changed file
with
18 additions
and
5 deletions
... | ... | @@ -5,14 +5,26 @@ export const formSchema: FormSchema[] = [ |
5 | 5 | field: 'passwordOld', |
6 | 6 | label: '当前密码', |
7 | 7 | component: 'InputPassword', |
8 | + componentProps: { | |
9 | + placeholder: '请输入当前密码', | |
10 | + }, | |
8 | 11 | required: true, |
9 | 12 | }, |
10 | 13 | { |
11 | 14 | field: 'passwordNew', |
12 | 15 | label: '新密码', |
13 | - component: 'StrengthMeter', | |
14 | - componentProps: { | |
15 | - placeholder: '新密码', | |
16 | + component: 'InputPassword', | |
17 | + componentProps({ formModel, formActionType }) { | |
18 | + return { | |
19 | + placeholder: '请输入新密码', | |
20 | + onInput({ target }) { | |
21 | + const { value } = target; | |
22 | + const { confirmPassword } = formModel; | |
23 | + if (value === confirmPassword) { | |
24 | + formActionType.clearValidate('confirmPassword'); | |
25 | + } | |
26 | + }, | |
27 | + }; | |
16 | 28 | }, |
17 | 29 | rules: [ |
18 | 30 | { |
... | ... | @@ -25,7 +37,9 @@ export const formSchema: FormSchema[] = [ |
25 | 37 | field: 'confirmPassword', |
26 | 38 | label: '确认密码', |
27 | 39 | component: 'InputPassword', |
28 | - | |
40 | + componentProps: { | |
41 | + placeholder: '请输入确认密码', | |
42 | + }, | |
29 | 43 | dynamicRules: ({ values }) => { |
30 | 44 | return [ |
31 | 45 | { |
... | ... | @@ -37,7 +51,6 @@ export const formSchema: FormSchema[] = [ |
37 | 51 | if (value !== values.passwordNew) { |
38 | 52 | return Promise.reject('两次输入的密码不一致!'); |
39 | 53 | } |
40 | - | |
41 | 54 | const pwdRegex = new RegExp(InputRegExp.PASSWORD_INPUT); |
42 | 55 | if (!pwdRegex.test(value)) { |
43 | 56 | return Promise.reject( | ... | ... |