| | |
| | | required: true, message: '请输入旧密码!', |
| | | }], |
| | | }, |
| | | password:{ |
| | | rules: [{ |
| | | required: true, message: '请输入新密码!',trigger:'blur' |
| | | }, { |
| | | validator: this.validateToNextPassword, |
| | | }, |
| | | { |
| | | pattern: /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,}$/, |
| | | message: '密码由8位数字、大小写字母和特殊符号组成!', |
| | | }], |
| | | }, |
| | | // password:{ |
| | | // rules: [{ |
| | | // required: true, message: '请输入新密码!',trigger:'blur' |
| | | // }, { |
| | | // validator: this.validateToNextPassword, |
| | | // }, |
| | | // { |
| | | // pattern: /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,}$/, |
| | | // message: '密码由8位数字、大小写字母和特殊符号组成!', |
| | | // }], |
| | | // }, |
| | | confirmpassword:{ |
| | | rules: [{ |
| | | required: true, message: '请确认新密码!', |
| | |
| | | username:"", |
| | | } |
| | | }, |
| | | created(){ |
| | | // this.initDictData('password_length') |
| | | watch:{ |
| | | visible:{ |
| | | handler(value){ |
| | | if(value) this.initDictData('password_length') |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | show(uname){ |
| | |
| | | } |
| | | }, |
| | | initDictData(dictCode) { |
| | | //优先从缓存中读取字典配置 |
| | | if (getDictItemsFromCache(dictCode)) { |
| | | return getDictItemsFromCache(dictCode); |
| | | } |
| | | //根据字典Code, 初始化字典数组 |
| | | ajaxGetDictItems(dictCode, null).then((res) => { |
| | | if (res.success) { |
| | | const regx = new RegExp(/^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{12,}$/); |
| | | const regExp = new RegExp("^(?=.*[a-zA-Z])(?=.*\\\d)(?=.*[~!@#$%^&*()_+`\\-={}:\";'<>?,./]).{"+Number(res.result[0].value)+",}$"); |
| | | this.validatorRules.password.rules[2]={ |
| | | pattern: regx, |
| | | message: '密码由8位数字、大小写字母和特殊符号组成!', |
| | | pattern: regExp, |
| | | message: `密码由${res.result[0].value}位数字、大小写字母和特殊符号组成!`, |
| | | } |
| | | return res.result |
| | | } |
| | | }) |
| | | }, |