From b706a686cf28b8dbaaeb69ebe93cab096ee54ebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=8A=B2=E6=9D=BE?= Date: Mon, 18 Jan 2021 16:42:32 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-471=20feat:=20account-box=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=97=B6=E5=A2=9E=E5=8A=A0=E6=94=B9=E5=AF=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/common/rightBox/accountBox.vue | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/nezha-fronted/src/components/common/rightBox/accountBox.vue b/nezha-fronted/src/components/common/rightBox/accountBox.vue index 330bd0c14..499a16ce1 100644 --- a/nezha-fronted/src/components/common/rightBox/accountBox.vue +++ b/nezha-fronted/src/components/common/rightBox/accountBox.vue @@ -17,19 +17,19 @@
- + - + - + @@ -112,10 +112,7 @@ }, data() { let validatePassword = (rule, value, callback) => { // 确认密码的二次校验 - console.log(value); - if (value === ''&& !this.editUser.password) { - callback(new Error(this.$t('validate.required'))); - }else if(value === ''&&this.editUser.password){ + if(value === '' && this.editUser.password){ callback(new Error(this.$t('config.account.inputConfirmPwd'))); }else if (value !== this.editUser.password) { callback(new Error(this.$t('config.account.confirmPwdErr'))); @@ -134,7 +131,21 @@ ], passwordChange: [ { validator: validatePassword, trigger: 'blur' }, - {required: true, message:'', trigger: 'blur'}, + {required: true, message: '', trigger: 'blur'}, + ], + roleIds: [ + {required: true, message: this.$t('validate.required'), trigger: 'blur'} + ], + email: [ + {type: 'email', message: this.$t('validate.email')} + ] + }, + rules2: { //表单校验规则 + username: [ + {required: true, message: this.$t('validate.required'), trigger: 'blur'} + ], + passwordChange: [ + { validator: validatePassword, trigger: 'blur' }, ], roleIds: [ {required: true, message: this.$t('validate.required'), trigger: 'blur'}