| | |
| | | import { error } from 'selenium-webdriver'; |
| | | import { HttpErrorResponse } from '@angular/common/http'; |
| | | import { Authorization } from '@business/entity/token'; |
| | | import { LoginService } from '@business/services/http/login.service'; |
| | | import { SettingsService } from '@delon/theme'; |
| | |
| | | this.router.navigate(['/']); |
| | | } |
| | | }, |
| | | (err) => { |
| | | // console.log(err); |
| | | if(err instanceof ProgressEvent){ |
| | | const error = <ProgressEvent>err; |
| | | let xmlHttp = error.target; |
| | | if(xmlHttp instanceof XMLHttpRequest){ |
| | | 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; |
| | | (err: HttpErrorResponse) => { |
| | | if (!!err) { |
| | | const errMsg = err.error; |
| | | console.log(errMsg); |
| | | if (errMsg.status === 401 && errMsg.errorCode === 10) { |
| | | this.validateError['password_incorrect'] = true; |
| | | this.loading = false; |
| | | } else if(response.status == 401&&response.errorCode==12) { |
| | | this.validateError["account_expired"]=true; |
| | | } else if (errMsg.status === 401 && errMsg.errorCode === 12) { |
| | | this.validateError['account_expired'] = true; |
| | | this.loading = false; |
| | | } |
| | | } |
| | | } |
| | | } |