implement token exp
This commit is contained in:
@@ -3,6 +3,7 @@ import { FormBuilder, FormGroup, NgForm, Validators } from "@angular/forms";
|
||||
import { ActivatedRoute, Router } from "@angular/router";
|
||||
import { BlockUI, NgBlockUI } from "ng-block-ui";
|
||||
import { BuildingService } from "../../service/monitoring-api.service";
|
||||
import { LoginService } from "../../service/login.service";
|
||||
|
||||
@Component({
|
||||
selector: "app-add-edit-device",
|
||||
@@ -36,9 +37,11 @@ export class AddEditDeviceComponent implements OnInit{
|
||||
private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
private monitoringApiService: BuildingService,
|
||||
private authService: LoginService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.authService.checkTokenAndRedirect();
|
||||
this.route.params.subscribe(params => {
|
||||
const id = params['id'];
|
||||
this.deviceId = id;
|
||||
|
||||
@@ -3,6 +3,7 @@ import { Router } from "@angular/router";
|
||||
import { BuildingService } from "../../service/monitoring-api.service";
|
||||
import { DeviceService } from "../../service/device.service";
|
||||
import { ToastrService } from "ngx-toastr";
|
||||
import { LoginService } from "../../service/login.service";
|
||||
|
||||
@Component({
|
||||
selector: "app-device-control",
|
||||
@@ -32,10 +33,12 @@ export class DeviceControlComponent {
|
||||
private router: Router,
|
||||
private deviceService: DeviceService,
|
||||
private monitoringApiService: BuildingService,
|
||||
private toastr: ToastrService
|
||||
private toastr: ToastrService,
|
||||
private authService: LoginService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.authService.checkTokenAndRedirect();
|
||||
this.breadcrumb = {
|
||||
mainlabel: "Device",
|
||||
links: [
|
||||
|
||||
@@ -9,6 +9,7 @@ import { ToastrService } from "ngx-toastr";
|
||||
import * as FileSaver from "file-saver";
|
||||
import * as XLSX from "xlsx";
|
||||
import { TableexcelService } from "src/app/_services/tableexcel.service";
|
||||
import { LoginService } from "../service/login.service";
|
||||
|
||||
@Component({
|
||||
selector: "app-device",
|
||||
@@ -47,10 +48,12 @@ export class DeviceComponent implements OnInit {
|
||||
private monitoringApiService: BuildingService,
|
||||
private deviceService: DeviceService,
|
||||
private toastr: ToastrService,
|
||||
private tableexcelService: TableexcelService
|
||||
private tableexcelService: TableexcelService,
|
||||
private authService: LoginService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.authService.checkTokenAndRedirect();
|
||||
this.breadcrumb = {
|
||||
mainlabel: "Device",
|
||||
links: [
|
||||
|
||||
Reference in New Issue
Block a user