xufenglei
2018-02-24 9e00209b2f1147759d4935e99f4c6ce3db0cb9a5
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') {