机构或角色删除后影响用户的问题修复

This commit is contained in:
zhouyuejun
2019-05-09 11:01:03 +08:00
parent 6704dca7f8
commit 833108cd0d
7 changed files with 99 additions and 52 deletions
+22 -15
View File
@@ -81,9 +81,9 @@ export class PagesComponent implements OnInit {
});
this.validateForm = this.fb.group({
oldPassword: ['', [Validators.required]],
newPassword: ['', [Validators.required]],
confirmPassword: ['', [Validators.required, this.confirmationValidator]],
oldPassword: ['', [Validators.required, Validators.minLength(2), Validators.maxLength(15)]],
newPassword: ['', [Validators.required, Validators.minLength(2), Validators.maxLength(15)]],
confirmPassword: ['', [Validators.required, this.confirmationValidator, Validators.minLength(2), Validators.maxLength(15)]],
});
}
@@ -111,19 +111,26 @@ export class PagesComponent implements OnInit {
}
modifyHandleOk(): void {
this.isConfirmLoading = true;
this.httpClient.post('/adminapi/xxxxx', this.validateForm.value).subscribe((response) => {
let params = {
"curPassword":this.validateForm.get('oldPassword').value,
"newPassword":this.validateForm.get('newPassword').value
}
this.httpClient.put('/sysapi/setting/user/cur/password', params).subscribe((response) => {
// console.log(response);
this.message.success('修改密码成功!');
this.validateForm.patchValue({
oldPassword: '',
newPassword: '',
confirmPassword: ''
})
for (const i in this.validateForm.controls) {
this.validateForm.controls[i].markAsPristine();
this.validateForm.controls[i].markAsUntouched();
this.validateForm.controls[i].updateValueAndValidity();
if(response.is_success){
this.message.success('修改密码成功!');
this.validateForm.patchValue({
oldPassword: '',
newPassword: '',
confirmPassword: ''
})
for (const i in this.validateForm.controls) {
this.validateForm.controls[i].markAsPristine();
this.validateForm.controls[i].markAsUntouched();
this.validateForm.controls[i].updateValueAndValidity();
}
}else{
this.message.error(response.err_msg + ',修改失败!');
}
this.modalIsVisible = false;
this.isConfirmLoading = false;