From 9e00209b2f1147759d4935e99f4c6ce3db0cb9a5 Mon Sep 17 00:00:00 2001 From: xufenglei <xufenglei> Date: Sat, 24 Feb 2018 11:43:35 +0800 Subject: [PATCH] 更新 --- src/app/routes/passport/login/login.component.ts | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/app/routes/passport/login/login.component.ts b/src/app/routes/passport/login/login.component.ts index 41331e2..b9d2aaf 100644 --- a/src/app/routes/passport/login/login.component.ts +++ b/src/app/routes/passport/login/login.component.ts @@ -86,7 +86,7 @@ name: this.userName.value, time: +new Date }); - this.validateError = true; + this.validateError = {}; this.router.navigate(['/']); } }, @@ -96,10 +96,15 @@ const error = <ProgressEvent>err; let xmlHttp = error.target; if(xmlHttp instanceof XMLHttpRequest){ - const xmlHttpRequest = <XMLHttpRequest> xmlHttp; - if(xmlHttpRequest.status == 401){ - this.validateError = true; + const xmlHttpRequest = <XMLHttpRequest> xmlHttp; + console.log(xmlHttpRequest.response); + const response = JSON.parse(xmlHttpRequest.response); + if(response.status == 401&&response.errorCode==10){ + this.validateError["password_incorrect"]=true; this.loading = false; + } else if(response.status == 401&&response.errorCode==12) { + this.validateError["account_expired"]=true; + this.loading = false; } } } @@ -107,7 +112,7 @@ ); } - public validateError:boolean; + public validateError:{[s:string]:boolean} = {}; // region: social open(type: string, openType: SocialOpenType = 'href') { -- Gitblit v1.8.0