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

Loading…
Cancel
Save