机构或角色删除后影响用户的问题修复
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user