commission--yt-commit
This commit is contained in:
@ -20,29 +20,40 @@ const formatPassword = (pwd , currentPwd) => {
|
||||
title: '密码不能为空',
|
||||
icon: 'error'
|
||||
})
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (pwd.length < 6) {
|
||||
if (pwd.length < 6 || pwd.length > 10) {
|
||||
wx.showToast({
|
||||
title: '密码不能小于6位',
|
||||
title: '密码长度必须在6-10位',
|
||||
icon: 'error'
|
||||
})
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (currentPwd === '') {
|
||||
wx.showToast({
|
||||
title: '请输入二次确认密码',
|
||||
icon: 'error'
|
||||
})
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (currentPwd !== pwd) {
|
||||
wx.showToast({
|
||||
title: '两次密码不一致',
|
||||
icon: 'error'
|
||||
})
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
// 纪文昊写的 密码必须包含字母和数字
|
||||
const hasLetter = /[a-zA-z]/.test(pwd);
|
||||
const hasNumber = /[0-9]/.test(pwd);
|
||||
if (!hasLetter || !hasNumber) {
|
||||
wx.showToast({
|
||||
title: '密码必须包含字母和数字',
|
||||
icon: 'none'
|
||||
})
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
Reference in New Issue
Block a user