|
@@ -98,6 +98,25 @@ let checkPassword = ref('')
|
|
|
|
|
|
//验证密码的正则 产品定的规则是:8位及以上,包含数字、大写字母、小写字母、特殊字符中的三个类型
|
|
|
const patternPassWord = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9]).{8,}$/
|
|
|
+function checkPwd(pwd){
|
|
|
+ let num = 0
|
|
|
+ const patternArr = [
|
|
|
+ /^(?=.*[0-9])/,
|
|
|
+ /^(?=.*[a-z])/,
|
|
|
+ /^(?=.*[A-Z])/,
|
|
|
+ /^(?=.*[@#$%^&+=.])/,
|
|
|
+ ]
|
|
|
+ patternArr.forEach(pattern=>{
|
|
|
+ if(pattern.test(pwd)){
|
|
|
+ num++
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if(pwd.length<8){
|
|
|
+ num = 0
|
|
|
+ }
|
|
|
+ return num>=3
|
|
|
+}
|
|
|
+
|
|
|
function resetPass(values){
|
|
|
if(checkPassStr.value.includes('去登陆')){
|
|
|
emit('changeModel')
|
|
@@ -130,6 +149,10 @@ const emit = defineEmits(['changeModel'])
|
|
|
function changeModel(){
|
|
|
if(currentStep.value > 0){
|
|
|
currentStep.value--
|
|
|
+ if(currentStep.value===0){
|
|
|
+ getPicCode()
|
|
|
+ accountCode.value = ''
|
|
|
+ }
|
|
|
}else{
|
|
|
emit('changeModel')
|
|
|
}
|
|
@@ -227,7 +250,7 @@ onMounted(()=>{
|
|
|
:rules="[
|
|
|
{ required: true, message: '请输入密码' },
|
|
|
{ validator:(val)=>{
|
|
|
- if(!patternPassWord.test(val)){
|
|
|
+ if(!checkPwd(val)){
|
|
|
return `密码要求8位及以上,包含数字、大写字母、小写字母、特殊字符中的三个类型`
|
|
|
}else{
|
|
|
return true
|