|
|
@@ -6,6 +6,7 @@
|
|
|
<div class="f-form">
|
|
|
<div class="page-part">
|
|
|
<mt-field placeholder="新密码"
|
|
|
+ type="password"
|
|
|
:attr="{ maxlength: 20 }"
|
|
|
:state="state.password"
|
|
|
@blur.native.capture="validPasswordTip"
|
|
|
@@ -18,6 +19,7 @@
|
|
|
</div>
|
|
|
<div class="page-part">
|
|
|
<mt-field placeholder="确认密码"
|
|
|
+ type="password"
|
|
|
:state="state.confirm"
|
|
|
auto-complet="off"
|
|
|
@blur.native.capture="validConfirm"
|
|
|
@@ -59,17 +61,12 @@
|
|
|
validPassword () {
|
|
|
let reg1 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]))|((?=.*[0-9])((?=.*[a-zA-Z]))(?=.*[^a-zA-Z0-9]))).*$/
|
|
|
let reg2 = /^(?=.{8,20})(((?=.*[0-9])(?=.*[a-z]))|((?=.*[0-9])(?=.*[A-Z]))).*$/
|
|
|
- let count = this.news.password.length
|
|
|
- if (count >= 20) {
|
|
|
- this.downToast('密码须为8-20字符的英文、数字混合')
|
|
|
+ if (reg1.test(this.news.password)) {
|
|
|
+ this.progress = '强'
|
|
|
+ } else if (reg2.test(this.news.password)) {
|
|
|
+ this.progress = '中'
|
|
|
} else {
|
|
|
- if (reg1.test(this.news.password)) {
|
|
|
- this.progress = '强'
|
|
|
- } else if (reg2.test(this.news.password)) {
|
|
|
- this.progress = '中'
|
|
|
- } else {
|
|
|
- this.progress = '弱'
|
|
|
- }
|
|
|
+ this.progress = '弱'
|
|
|
}
|
|
|
},
|
|
|
// 验证新密码
|