Mofify admin can't change existing pwd

This commit is contained in:
pfh 2018-06-04 16:08:46 +08:00
parent 0d4aaccd13
commit 81271c8e31
5 changed files with 16 additions and 8 deletions

View File

@ -17,6 +17,7 @@ import { NgForm } from '@angular/forms';
import { InlineAlertComponent } from '../../shared/inline-alert/inline-alert.component';
import { MessageHandlerService } from '../../shared/message-handler/message-handler.service';
import {UserService} from "../user.service";
import {TranslateService} from "@ngx-translate/core";
@Component({
selector: 'change-password',
@ -41,6 +42,7 @@ export class ChangePasswordComponent {
constructor(
private userService: UserService,
private msgHandler: MessageHandlerService,
private translateService: TranslateService,
private ref: ChangeDetectorRef) { }
public get showProgress(): boolean {
@ -106,12 +108,14 @@ export class ChangePasswordComponent {
})
.catch(error => {
this.onGoing = false;
if (this.msgHandler.isAppLevel(error)) {
this.msgHandler.handleError(error);
this.opened = false;
} else {
if (error.status === 400) {
this.translateService.get("USER.EXISTING_PASSWORD").subscribe(
res => {this.inlineAlert.showInlineError(res); });
}else {
this.inlineAlert.showInlineError(error);
}
let hnd = setInterval(() => this.ref.markForCheck(), 100);
setTimeout(() => clearInterval(hnd), 2000);
});
}

View File

@ -136,7 +136,8 @@
"DELETE_SUCCESS": "Users deleted successfully.",
"ITEMS": "items",
"OF": "of",
"RESET_Ok": "Users password reset successfully"
"RESET_Ok": "Users password reset successfully",
"EXISTING_PASSWORD": "The new password can not be same with the old one"
},
"PROJECT": {
"PROJECTS": "Projects",

View File

@ -136,7 +136,8 @@
"DELETE_SUCCESS": "Usuario eliminado satisfactoriamente.",
"ITEMS": "elementos",
"OF": "of",
"RESET_Ok": "Users password reset successfully"
"RESET_Ok": "Users password reset successfully",
"EXISTING_PASSWORD": "The new password can not be same with the old one"
},
"PROJECT": {
"PROJECTS": "Proyectos",

View File

@ -119,7 +119,8 @@
"DELETE_SUCCESS": "Utilisateur supprimé avec succès.",
"ITEMS": "items",
"OF": "de",
"RESET_Ok": "Users password reset successfully"
"RESET_Ok": "Users password reset successfully",
"EXISTING_PASSWORD": "The new password can not be same with the old one"
},
"PROJECT": {
"PROJECTS": "Projets",

View File

@ -136,7 +136,8 @@
"DELETE_SUCCESS": "成功删除用户。",
"OF": "共计",
"ITEMS": "条记录",
"RESET_Ok": "成功修改用户密码"
"RESET_Ok": "成功修改用户密码",
"EXISTING_PASSWORD": "新密码不能与旧密码一致"
},
"PROJECT": {
"PROJECTS": "项目",