Browse Source

油站高亮以及登录判断

beijing
陈鹏飞 3 years ago
parent
commit
a8fcc0fdb7
  1. 13
      src/app/pages/home/home.component.ts
  2. 2
      src/app/pages/init3D.guard.ts
  3. 4
      src/app/pages/login/login.component.ts

13
src/app/pages/home/home.component.ts

@ -75,12 +75,15 @@ export class HomeComponent implements OnInit {
menuList2 = []
selectedItem
routerChange(item) {
// console.log( sessionStorage.getItem("3dSceneData"));
let a=JSON.parse(sessionStorage.getItem("3dSceneData"))
if(!a.hasBuildingInfo && item.url == "/plan/petrolStation"){
this.message.info("当前油站未开通!");
return
console.log( sessionStorage.getItem("3dSceneData"));
if(JSON.parse(sessionStorage.getItem('isGasStation'))){
let a=JSON.parse(sessionStorage.getItem("3dSceneData"))
if(!a.hasBuildingInfo && item.url == "/plan/petrolStation"){
this.message.info("当前油站未开通!");
return
}
}
if (item.name == this.selectedItem) {
return
}

2
src/app/pages/init3D.guard.ts

@ -16,7 +16,7 @@ export class init3DGuard implements CanActivate {
// 路由守卫
canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot,): Promise<boolean> {
return this.getGasStationBaseInfo().then((res: any) => {
sessionStorage.setItem("3dSceneData", JSON.stringify(res))
// sessionStorage.setItem("3dSceneData", JSON.stringify(res))
let userdata = JSON.parse(sessionStorage.getItem('userdata'))
if (userdata.userName == 'superadmin') { //是superadmin,是内部制作账号
ModeManager.s_isMakeMode = true;

4
src/app/pages/login/login.component.ts

@ -101,6 +101,10 @@ export class LoginComponent implements OnInit {
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)
sessionStorage.setItem("3dSceneData", JSON.stringify(data.result))
console.log(sessionStorage.getItem("3dSceneData"),208);
this.init3D = data.result.hasBuildingInfo
})

Loading…
Cancel
Save