|
|
|
@ -96,14 +96,12 @@ export class LoginComponent implements OnInit {
|
|
|
|
|
{ name: '证照管理', url: '/license/petrolStation' }, |
|
|
|
|
] |
|
|
|
|
init3D |
|
|
|
|
getGasStationBaseInfo() { |
|
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
|
async getGasStationBaseInfo() { |
|
|
|
|
new Promise((resolve, reject) => { |
|
|
|
|
let params = { organizationUnitId: (JSON.parse(sessionStorage.getItem('userdataOfgasstation'))).organization.id } |
|
|
|
|
this.http.get('/api/services/app/GasStation/Get', { params: params }).subscribe((data: any) => { |
|
|
|
|
resolve(data.result) |
|
|
|
|
this.init3D=data.result.hasBuildingInfo |
|
|
|
|
console.log(this.init3D); |
|
|
|
|
|
|
|
|
|
this.init3D = data.result.hasBuildingInfo |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
@ -134,9 +132,9 @@ export class LoginComponent implements OnInit {
|
|
|
|
|
(data: any) => { |
|
|
|
|
sessionStorage.setItem("token", data.result.accessToken); |
|
|
|
|
sessionStorage.setItem("encryptedAccessToken", data.result.encryptedAccessToken); |
|
|
|
|
this.http.get('/api/services/app/Session/GetCurrentLoginInformations').subscribe((data: any) => { |
|
|
|
|
this.http.get('/api/services/app/Session/GetCurrentLoginInformations').subscribe(async (data: any) => { |
|
|
|
|
console.log('GetCurrentLoginInformations', data.result) |
|
|
|
|
if (data.result.user.menus.length == 0 && data.result.user.userName!="admin") { |
|
|
|
|
if (data.result.user.menus.length == 0 && data.result.user.userName != "admin") { |
|
|
|
|
this.message.create('error', `当前用户未分配菜单`); |
|
|
|
|
this.isLoading = false |
|
|
|
|
return |
|
|
|
@ -147,9 +145,11 @@ export class LoginComponent implements OnInit {
|
|
|
|
|
sessionStorage.setItem('isDefaultPassword', JSON.stringify(data.result.user.isDefaultPassword)) |
|
|
|
|
sessionStorage.setItem('isPasswordExpired', JSON.stringify(data.result.user.isPasswordExpired)) |
|
|
|
|
this.isLoading = false; |
|
|
|
|
if(data.result.user.organization.isGasStation){ |
|
|
|
|
this.getGasStationBaseInfo() |
|
|
|
|
if(data.result.user.menus[0].name=="数字油站" && data.result.user.menus.length==1&&!this.init3D){ |
|
|
|
|
if (data.result.user.organization.isGasStation) { |
|
|
|
|
|
|
|
|
|
await this.getGasStationBaseInfo() |
|
|
|
|
|
|
|
|
|
if (data.result.user.menus[0].name == "数字油站" && data.result.user.menus.length == 1 && !this.init3D) { |
|
|
|
|
this.message.create('error', `当前用户油站未开通3D且仅分配油站菜单`); |
|
|
|
|
return |
|
|
|
|
|
|
|
|
@ -173,10 +173,10 @@ export class LoginComponent implements OnInit {
|
|
|
|
|
if (isTrue) { |
|
|
|
|
this.router.navigate(['/todaywarning/petrolStation']) |
|
|
|
|
sessionStorage.setItem('selectedMenu', '今日预警') |
|
|
|
|
} else if(data.result.user.menus[0].name=="数字油站" && !this.init3D) { |
|
|
|
|
} else if (data.result.user.menus[0].name == "数字油站" && !this.init3D) { |
|
|
|
|
this.router.navigate([menuList[1].url]) |
|
|
|
|
sessionStorage.setItem('selectedMenu', menuList[1].name) |
|
|
|
|
}else{ |
|
|
|
|
} else { |
|
|
|
|
this.router.navigate([menuList[0].url]) |
|
|
|
|
sessionStorage.setItem('selectedMenu', menuList[0].name) |
|
|
|
|
} |
|
|
|
|