feat: add ConfirmPassword Validate (#116)

* feat: add ConfirmPassword Validate

* Update Installation.vue
pull/125/head
FireflyHoo 2020-04-04 16:44:58 +08:00 committed by GitHub
parent e397180cde
commit 3a491c4e42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -114,7 +114,7 @@
placeholder="确定密码"
v-decorator="[
'confirmPassword',
{rules: [{ required: true, message: '请确定密码' }]}
{rules: [{ required: true, message: '请确定密码' },{ validator: handleValidateConfirmPassword }]}
]"
>
<a-icon
@ -231,6 +231,12 @@ export default {
this.$set(this.installation, 'url', window.location.protocol + '//' + window.location.host)
},
methods: {
handleValidateConfirmPassword(rule,value, callback){
if (this.installation.confirmPassword && this.installation.password !== this.installation.confirmPassword ) {
callback('确认密码和密码不匹配')
}
callback()
},
verifyIsInstall() {
adminApi.isInstalled().then(response => {
if (response.data.data) {