|
|
@ -10,12 +10,21 @@ import { NzMessageService } from 'ng-zorro-antd/message'; |
|
|
|
}) |
|
|
|
}) |
|
|
|
export class init3DGuard implements CanActivate { |
|
|
|
export class init3DGuard implements CanActivate { |
|
|
|
|
|
|
|
|
|
|
|
constructor(private router: Router, private http: HttpClient, private message: NzMessageService,) { } |
|
|
|
constructor(private router: Router, private http: HttpClient, private message: NzMessageService,) { } |
|
|
|
|
|
|
|
|
|
|
|
// 路由守卫
|
|
|
|
// 路由守卫
|
|
|
|
canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot,): Promise<boolean> { |
|
|
|
canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot,): Promise<boolean> { |
|
|
|
return this.getGasStationBaseInfo().then((res: any) => { |
|
|
|
return this.getGasStationBaseInfo().then((res: any) => { |
|
|
|
sessionStorage.setItem("3dSceneData", JSON.stringify(res)) |
|
|
|
sessionStorage.setItem("3dSceneData", JSON.stringify(res)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (true) //是superadmin,是内部制作账号
|
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
ModeManager.s_isMakeMode = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
ModeManager.s_isMakeMode = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let isMakeMode = ModeManager.s_isMakeMode |
|
|
|
let isMakeMode = ModeManager.s_isMakeMode |
|
|
|
if (isMakeMode || res.hasBuildingInfo) { |
|
|
|
if (isMakeMode || res.hasBuildingInfo) { |
|
|
|
return true |
|
|
|
return true |
|
|
@ -30,7 +39,7 @@ export class init3DGuard implements CanActivate { |
|
|
|
getGasStationBaseInfo() { |
|
|
|
getGasStationBaseInfo() { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
let params = { organizationUnitId: (JSON.parse(sessionStorage.getItem('userdataOfgasstation'))).organization.id } |
|
|
|
let params = { organizationUnitId: (JSON.parse(sessionStorage.getItem('userdataOfgasstation'))).organization.id } |
|
|
|
this.http.get('/api/services/app/GasStation/Get', { params: params }).subscribe((data: any)=>{ |
|
|
|
this.http.get('/api/services/app/GasStation/Get', { params: params }).subscribe((data: any) => { |
|
|
|
resolve(data.result) |
|
|
|
resolve(data.result) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|