Commit a1691abc authored by GuanHua's avatar GuanHua

fix: 注册页面密码校验提示

parent 1d8932ff
......@@ -51,9 +51,7 @@ const useLinkageValidateEffects = () => {
countryCode: prefixCode,
phone: fieldState.value
}, { ctlType: 'none', useCache: true, ttl: 60 * 1000 }).then(({ code, data }) => {
if (code === 1000) {
} else {
if (code !== 1000) {
setFieldState('phone', state => {
state.errors = ['手机号已存在']
})
......@@ -61,19 +59,10 @@ const useLinkageValidateEffects = () => {
})
}
})
onFieldValueChange$('*(password,confirmPassword)').subscribe(fieldState => {
const selfName = fieldState.name
onFieldValueChange$('*(confirmPassword)').subscribe(fieldState => {
const selfValue = fieldState.value
const otherName = selfName == 'password' ? 'confirmPassword' : 'password'
const otherValue = getFieldState(otherName, state => state.value)
setFieldState(otherName, state => {
if (selfValue && otherValue && selfValue !== otherValue) {
state.errors = ['两次密码输入不一致']
} else {
state.errors = ['']
}
})
setFieldState(selfName, state => {
const otherValue = getFieldState('password', state => state.value)
setFieldState('confirmPassword', state => {
if (selfValue && otherValue && selfValue !== otherValue) {
state.errors = ['两次密码输入不一致']
} else {
......@@ -81,6 +70,26 @@ const useLinkageValidateEffects = () => {
}
})
})
// onFieldValueChange$('*(password,confirmPassword)').subscribe(fieldState => {
// const selfName = fieldState.name
// const selfValue = fieldState.value
// const otherName = selfName == 'password' ? 'confirmPassword' : 'password'
// const otherValue = getFieldState(otherName, state => state.value)
// setFieldState(otherName, state => {
// if (selfValue && otherValue && selfValue !== otherValue) {
// state.errors = ['两次密码输入不一致']
// } else {
// state.errors = ['']
// }
// })
// setFieldState(selfName, state => {
// if (selfValue && otherValue && selfValue !== otherValue) {
// state.errors = ['两次密码输入不一致']
// } else {
// state.errors = ['']
// }
// })
// })
}
let timeChange: any; // 定时器
......
......@@ -80,10 +80,10 @@ export const registerStep0Schema: ISchema = {
required: true,
message: '请输入密码'
},
{
pattern: PATTERN_MAPS.password,
message: '请输入正确的密码'
}
// {
// pattern: PATTERN_MAPS.password,
// message: '请输入正确的密码'
// }
],
"x-component-props": {
type: 'password',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment