|
|
|
@ -106,7 +106,7 @@ export class LoginComponent implements OnInit {
|
|
|
|
|
sessionStorage.setItem("token", data.result.accessToken); |
|
|
|
|
this.cookieService.set("token", data.result.accessToken, null, '/'); |
|
|
|
|
this.cookieService.set("refreshToken", data.result.encryptedAccessToken, null, '/'); |
|
|
|
|
sessionStorage.setItem("encryptedAccessToken",data.result.encryptedAccessToken); |
|
|
|
|
sessionStorage.setItem("encryptedAccessToken", data.result.encryptedAccessToken); |
|
|
|
|
console.log('token', data) |
|
|
|
|
this.http.get('/api/services/app/Session/GetCurrentLoginInformations').subscribe((data: any) => { |
|
|
|
|
sessionStorage.setItem('userdata', JSON.stringify(data.result.user)) |
|
|
|
@ -119,21 +119,18 @@ export class LoginComponent implements OnInit {
|
|
|
|
|
if (data.result.user.userName == 'admin') { |
|
|
|
|
sessionStorage.setItem("isGasStation", 'false'); |
|
|
|
|
this.router.navigate(['/system/organization']) |
|
|
|
|
this.message.create('success', `登陆成功`); |
|
|
|
|
} else { |
|
|
|
|
if (data.result.user.organization.isGasStation) { |
|
|
|
|
sessionStorage.setItem("isGasStation", 'true'); |
|
|
|
|
this.router.navigate(['/warning/petrolStation']) |
|
|
|
|
this.message.create('success', `登陆成功`); |
|
|
|
|
} else { |
|
|
|
|
sessionStorage.setItem("isGasStation", 'false'); |
|
|
|
|
this.router.navigate(['/homepage']) |
|
|
|
|
this.message.create('success', `登陆成功`); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.message.create('success', `登陆成功`); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let _this = this; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, err => { |
|
|
|
|
this.isLoading = false; |
|
|
|
|
}) |
|
|
|
|