|
@@ -14,7 +14,7 @@
|
|
|
</div>
|
|
|
<div class="item">
|
|
|
<van-cell-group>
|
|
|
- <van-field v-model="password2" type="password" placeholder="请再次输入密码" />
|
|
|
+ <van-field v-model="confirmPassword" type="password" placeholder="请再次输入密码" />
|
|
|
</van-cell-group>
|
|
|
</div>
|
|
|
<div class="btn">
|
|
@@ -38,7 +38,7 @@ export default {
|
|
|
titlename: "修改密码",
|
|
|
name: "",
|
|
|
password: "",
|
|
|
- password2: "",
|
|
|
+ confirmPassword: "",
|
|
|
yzm: "",
|
|
|
userId: "",
|
|
|
}
|
|
@@ -49,15 +49,19 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
async save() {
|
|
|
+ if (!/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{8,}$/.test(this.confirmPassword)) {
|
|
|
+ Toast('密码需包含大小写字母及数字,长度至少为8位!');
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (this.password == '' || this.password == undefined) {
|
|
|
Toast('请输入密码!');
|
|
|
return;
|
|
|
}
|
|
|
- if (this.password2 == '' || this.password2 == undefined) {
|
|
|
+ if (this.confirmPassword == '' || this.confirmPassword == undefined) {
|
|
|
Toast('请再次输入密码!');
|
|
|
return;
|
|
|
}
|
|
|
- if (this.password2 != this.password) {
|
|
|
+ if (this.confirmPassword != this.password) {
|
|
|
Toast('两次输入密码不相同!');
|
|
|
return;
|
|
|
}
|