fix
This commit is contained in:
@@ -38,4 +38,6 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="radial-progress text-primary" style="--value:70; --size:12rem; --thickness: 1.5rem;"><span style="font-size: 20pt">70%</span></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ export class LoginComponent implements OnInit {
|
|||||||
this.newUser.password = createUser.password;
|
this.newUser.password = createUser.password;
|
||||||
this.userService.createUser(this.newUser).subscribe(user => {
|
this.userService.createUser(this.newUser).subscribe(user => {
|
||||||
this.cookieService.setUsername(createUser.username);
|
this.cookieService.setUsername(createUser.username);
|
||||||
this.router.navigate(['/management']);
|
this.router.navigate(['/home']);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -55,7 +55,7 @@ export class LoginComponent implements OnInit {
|
|||||||
this.userService.getUser(username).subscribe(user => {
|
this.userService.getUser(username).subscribe(user => {
|
||||||
if (user.password == password) {
|
if (user.password == password) {
|
||||||
this.cookieService.setUsername(username);
|
this.cookieService.setUsername(username);
|
||||||
this.router.navigate(['/management']);
|
this.router.navigate(['/home']);
|
||||||
} else {
|
} else {
|
||||||
this.errorLogin = true;
|
this.errorLogin = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import {Component, OnInit} from '@angular/core';
|
|||||||
import {UserEntity} from "../../interface/UserEntity";
|
import {UserEntity} from "../../interface/UserEntity";
|
||||||
import {LocationEntity} from "../../interface/LocationEntity";
|
import {LocationEntity} from "../../interface/LocationEntity";
|
||||||
import {WaypointsEntity} from "../../interface/WaypointsEntity";
|
import {WaypointsEntity} from "../../interface/WaypointsEntity";
|
||||||
import {ActivatedRoute} from "@angular/router";
|
import {Router} from "@angular/router";
|
||||||
import {LocationService} from "../../service/http/location.service";
|
import {LocationService} from "../../service/http/location.service";
|
||||||
import {UserService} from "../../service/http/user.service";
|
import {UserService} from "../../service/http/user.service";
|
||||||
import {WaypointService} from "../../service/http/waypoint.service";
|
import {WaypointService} from "../../service/http/waypoint.service";
|
||||||
@@ -35,7 +35,7 @@ export class ManagementComponent implements OnInit {
|
|||||||
translations: managementTranslations = {} as managementTranslations
|
translations: managementTranslations = {} as managementTranslations
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private route: ActivatedRoute,
|
private route: Router,
|
||||||
private locationService: LocationService,
|
private locationService: LocationService,
|
||||||
private waypointService: WaypointService,
|
private waypointService: WaypointService,
|
||||||
private userService: UserService,
|
private userService: UserService,
|
||||||
@@ -48,6 +48,11 @@ export class ManagementComponent implements OnInit {
|
|||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.translations = this.readTranslationJsonService.getManagementTranslations();
|
this.translations = this.readTranslationJsonService.getManagementTranslations();
|
||||||
this.username = this.cookieService.getUsername();
|
this.username = this.cookieService.getUsername();
|
||||||
|
this.userService.getUser(this.username).subscribe(user => {
|
||||||
|
if (user.admin == false) {
|
||||||
|
this.route.navigate(['/home']);
|
||||||
|
}
|
||||||
|
});
|
||||||
this.locationService.getLocations().subscribe(locations => {
|
this.locationService.getLocations().subscribe(locations => {
|
||||||
this.locations = locations;
|
this.locations = locations;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user