|
|
|
|
@ -62,9 +62,9 @@
|
|
|
|
|
<el-input size="large" v-model="oldpwd" type="password" placeholder="新密码"
|
|
|
|
|
style=" margin: auto 20px;" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="新密码">
|
|
|
|
|
<el-form-item label="新密码"><span v-if="strengthText" style="font-size: 12px;color:#999">密码强度:{{strengthText}}</span>
|
|
|
|
|
<el-input size="large" v-model="newpwd" type="password" placeholder="新密码"
|
|
|
|
|
style=" margin: auto 20px;" />
|
|
|
|
|
style=" margin: auto 20px;" @input="checkPasswordStrength" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="再次输入">
|
|
|
|
|
<el-input size="large" v-model="renewpwd" type="password" placeholder="再次输入"
|
|
|
|
|
@ -336,8 +336,44 @@
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const strengthText = ref('');
|
|
|
|
|
|
|
|
|
|
const checkPasswordStrength = (value) => {
|
|
|
|
|
let strength = 0;
|
|
|
|
|
if (value.length >= 8) strength++;
|
|
|
|
|
if (/[a-z]/.test(value)) strength++;
|
|
|
|
|
if (/[A-Z]/.test(value)) strength++;
|
|
|
|
|
if (/\d/.test(value)) strength++;
|
|
|
|
|
if (/[\W_]/.test(value)) strength++;
|
|
|
|
|
|
|
|
|
|
switch (strength) {
|
|
|
|
|
case 0:
|
|
|
|
|
strengthText.value = '无';
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
strengthText.value = '弱';
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
strengthText.value = '较弱';
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
strengthText.value = '中等';
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
strengthText.value = '较强';
|
|
|
|
|
break;
|
|
|
|
|
case 5:
|
|
|
|
|
strengthText.value = '强';
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
strengthText.value = '';
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|