Browse Source

添加密码与确认密码的相同校验

main
TonyStark 2 months ago
parent
commit
4977cb0b0c
  1. 42
      src/views/business/userRegister/index.vue

42
src/views/business/userRegister/index.vue

@ -187,7 +187,7 @@
<el-input v-model="form.passwd" show-password placeholder="请输入密码" />
</el-form-item>
<el-form-item label="确认密码" prop="passwd_re">
<el-input v-model="form.passwd_re" show-password placeholder="请输入密码" />
<el-input v-model="form.passwd_re" show-password placeholder="请再次输入密码" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@ -547,22 +547,26 @@ export default {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
if (this.form.id != null) {
updateUserRegister(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
} else {
addUserRegister(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
if (this.form.passwd != this.form.passwd_re){
this.$modal.msgError("修改失败,两次输入的密码不同");
}else{
if (this.form.id != null) {
updateUserRegister(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
} else {
addUserRegister(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
}
}
});
@ -597,8 +601,8 @@ export default {
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除用户注册编号为"' + ids + '"的数据项?').then(() => {
const account = row.account;
this.$modal.confirm('是否确认删除登录账号为"' + account + '"的数据项?').then(() => {
this.loading = true;
return delUserRegister(ids);
}).then(() => {

Loading…
Cancel
Save