修改密码

This commit is contained in:
@fawn-nine
2023-10-16 17:49:14 +08:00
parent 05829f5617
commit bd998074a3
4 changed files with 305 additions and 227 deletions

View File

@@ -91,14 +91,14 @@
<u-popup :show="passwordShow" :round="10" @close="cancelPass">
<view class="tanchu">
<view class="dp_title">请修改密码</view>
<u--input v-model="userMes.password" placeholder="请输入新密码" :password="true" border="surround" clearable
<u--input maxlength="8" v-model="userMes.password" placeholder="请输入新密码" :password="true" border="surround" clearable
@input="inputMethod(userMes.password)">
</u--input>
<view class="" style="font-size: 28rpx; color: #999;">
<p v-if="note != ''">{{note}}</p>
<p v-html="str2" style="margin-top: 10rpx;"></p>
</view>
<u--input v-model="userMes.Repassword" placeholder="请再确认密码" :password="true" border="surround" clearable
<u--input maxlength="8" v-model="userMes.Repassword" placeholder="请再确认密码" :password="true" border="surround" clearable
style="margin-top: 20rpx;"></u--input>
<u-button color="linear-gradient(to right, #72d386, #317e42)" text="确定" @click="chosePassword()"
style="margin-top: 50rpx;"></u-button>
@@ -207,24 +207,26 @@
// 密码验证
inputMethod(value) {
this.passwordOk = false
console.log('输入的值为:', value)
// console.log('输入的值为:', value)
if (strongRegex.test(value)) {
//console.log('强密码-----',value)
this.str2 = "<span style='color:#18bc37'>密码强度很不错哦!</span>"
// this.note = '请至少使用大小写字母、数字、符号两种类型组合的密码,长度至少为8位。'
// this.note = '请至少使用大小写字母、数字、符号两种类型组合的密码长度为8位。'
this.note = ''
this.passwordOk = true
} else if (mediumRegex.test(value)) {
//console.log('中等密码-----',value)
this.note = '请至少使用大小写字母、数字、符号两种类型组合的密码,长度至少为8位。'
this.note = '请至少使用大小写字母、数字、符号两种类型组合的密码长度为8位。'
this.str2 = "<span style='color:#2979ff'>密码强度中等!</span>"
this.passwordOk = true
} else if (enoughRegex.test(value)) {
//console.log('弱密码-----',value)
this.str2 = "<span style='color:#f3a73f'>密码强度太弱!</span>"
this.note = '请至少使用大小写字母、数字、符号两种类型组合的密码,长度至少为8位。'
this.note = '请至少使用大小写字母、数字、符号两种类型组合的密码长度为8位。'
} else {
this.note = '请至少使用大小写字母、数字、符号两种类型组合的密码长度至少为8位。'
this.passwordOk = false
this.note = '请至少使用大小写字母、数字、符号两种类型组合的密码长度为8位。'
this.str2 = ""
//console.log('密码-----',value)
}
},