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