|
|
|
@ -16,6 +16,15 @@ export class init3DGuard implements CanActivate {
|
|
|
|
|
canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot,): Promise<boolean> { |
|
|
|
|
return this.getGasStationBaseInfo().then((res: any) => { |
|
|
|
|
sessionStorage.setItem("3dSceneData", JSON.stringify(res)) |
|
|
|
|
|
|
|
|
|
if (true) //是superadmin,是内部制作账号
|
|
|
|
|
{ |
|
|
|
|
ModeManager.s_isMakeMode = true; |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
ModeManager.s_isMakeMode = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
let isMakeMode = ModeManager.s_isMakeMode |
|
|
|
|
if (isMakeMode || res.hasBuildingInfo) { |
|
|
|
|
return true |
|
|
|
@ -30,7 +39,7 @@ export class init3DGuard implements CanActivate {
|
|
|
|
|
getGasStationBaseInfo() { |
|
|
|
|
return 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)=>{ |
|
|
|
|
this.http.get('/api/services/app/GasStation/Get', { params: params }).subscribe((data: any) => { |
|
|
|
|
resolve(data.result) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|