|
@@ -16,10 +16,11 @@
|
|
|
'formCustom.oldPwd',
|
|
|
{ initialValue: formCustom.oldPwd,
|
|
|
rules: [
|
|
|
- { required: true, message: '请输入原始密码' },
|
|
|
+ { required: true, message: '请输入原始密码' }
|
|
|
]
|
|
|
},
|
|
|
- ]">
|
|
|
+ ]"
|
|
|
+ placeholder="请输入原始密码">
|
|
|
</a-input>
|
|
|
</a-form-item>
|
|
|
<!-- 新密码 -->
|
|
@@ -34,10 +35,13 @@
|
|
|
'formCustom.passwd',
|
|
|
{ initialValue: formCustom.passwd,
|
|
|
rules: [
|
|
|
- { required: true, message: '请输入新密码' }
|
|
|
+ { required: true, message: '请输入新密码(6~12位)' },
|
|
|
+ { validator: passwordValid }
|
|
|
]
|
|
|
},
|
|
|
- ]">
|
|
|
+ ]"
|
|
|
+ :maxLength="12"
|
|
|
+ placeholder="请输入新密码(6~12位)">
|
|
|
</a-input>
|
|
|
</a-form-item>
|
|
|
<!-- 再次确认 -->
|
|
@@ -52,11 +56,13 @@
|
|
|
'formCustom.passwdCheck',
|
|
|
{ initialValue: formCustom.passwdCheck,
|
|
|
rules: [
|
|
|
- { required: true, message: '请再次输入密码' },
|
|
|
+ { required: true, message: '请再次输入密码(6~12位)' },
|
|
|
{ validator: compareToFirstPassword }
|
|
|
]
|
|
|
},
|
|
|
- ]">
|
|
|
+ ]"
|
|
|
+ :maxLength="12"
|
|
|
+ placeholder="请再次输入密码(6~12位)">
|
|
|
</a-input>
|
|
|
</a-form-item>
|
|
|
<a-col span="16" offset="8">
|
|
@@ -101,6 +107,14 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
...mapActions(['Logout']),
|
|
|
+ // 密码位数校验
|
|
|
+ passwordValid (rule, value, callback) {
|
|
|
+ if (value.length < 6 || value.length > 12) {
|
|
|
+ callback('请输入6~12位密码!')
|
|
|
+ } else {
|
|
|
+ callback()
|
|
|
+ }
|
|
|
+ },
|
|
|
// 密码校验
|
|
|
compareToFirstPassword (rule, value, callback) {
|
|
|
const form = this.form
|