Change API for user
This commit is contained in:
parent
c750e4778d
commit
32540659d5
@ -1,7 +1,7 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
const AUTH_API = 'https://aktienbot.flokaiser.com/api/';
|
const AUTH_API = 'https://aktienbot.flokaiser.com/api/user';
|
||||||
const httpOptions = {
|
const httpOptions = {
|
||||||
headers: new HttpHeaders({ 'Content-Type': 'application/json' }),
|
headers: new HttpHeaders({ 'Content-Type': 'application/json' }),
|
||||||
};
|
};
|
||||||
|
@ -7,6 +7,16 @@ export interface PeriodicElement {
|
|||||||
symbol: string;
|
symbol: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface Stock {
|
||||||
|
symbol: string;
|
||||||
|
count: Float32Array;
|
||||||
|
lastTransaction: Date;
|
||||||
|
boughtPrice: Float32Array;
|
||||||
|
currentPrice: Float32Array;
|
||||||
|
}
|
||||||
|
|
||||||
|
//symbol count lastTransaction boughtPrice currentPrice(+?)
|
||||||
|
|
||||||
const ELEMENT_DATA: PeriodicElement[] = [
|
const ELEMENT_DATA: PeriodicElement[] = [
|
||||||
{ position: 1, name: 'Hydrogen', weight: 1.0079, symbol: 'H' },
|
{ position: 1, name: 'Hydrogen', weight: 1.0079, symbol: 'H' },
|
||||||
{ position: 2, name: 'Helium', weight: 4.0026, symbol: 'He' },
|
{ position: 2, name: 'Helium', weight: 4.0026, symbol: 'He' },
|
||||||
|
@ -1,11 +1,4 @@
|
|||||||
<mat-toolbar>
|
<mat-toolbar>
|
||||||
<button
|
|
||||||
mat-icon-button
|
|
||||||
class="example-icon"
|
|
||||||
aria-label="Example icon-button with menu icon"
|
|
||||||
>
|
|
||||||
<mat-icon>menu</mat-icon>
|
|
||||||
</button>
|
|
||||||
<span>Aktienbot</span>
|
<span>Aktienbot</span>
|
||||||
<span class="example-spacer"></span>
|
<span class="example-spacer"></span>
|
||||||
<button
|
<button
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
(ngSubmit)="f.form.valid && onSubmit()"
|
(ngSubmit)="f.form.valid && onSubmit()"
|
||||||
#f="ngForm"
|
#f="ngForm"
|
||||||
novalidate
|
novalidate
|
||||||
|
class="backgorund"
|
||||||
>
|
>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="username">Username</label>
|
<label for="username">Username</label>
|
||||||
|
@ -7,3 +7,8 @@
|
|||||||
.no-border {
|
.no-border {
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.backgorund {
|
||||||
|
background-color: #181a1b;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
(ngSubmit)="f.form.valid && onSubmit()"
|
(ngSubmit)="f.form.valid && onSubmit()"
|
||||||
#f="ngForm"
|
#f="ngForm"
|
||||||
novalidate
|
novalidate
|
||||||
|
class="backgorund"
|
||||||
>
|
>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="username">Username</label>
|
<label for="username">Username</label>
|
||||||
|
@ -7,3 +7,8 @@
|
|||||||
.no-border {
|
.no-border {
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.backgorund {
|
||||||
|
background-color: #181a1b;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
@ -33,17 +33,17 @@ export class AppComponent {
|
|||||||
(event as NavigationEnd).url === '/login' ||
|
(event as NavigationEnd).url === '/login' ||
|
||||||
(event as NavigationEnd).url === '/register'
|
(event as NavigationEnd).url === '/register'
|
||||||
);
|
);
|
||||||
if (this.tokenStorage.getToken()) {
|
// if (this.tokenStorage.getToken()) {
|
||||||
this.isLoggedIn = true;
|
// this.isLoggedIn = true;
|
||||||
} else {
|
// } else {
|
||||||
this.isLoggedIn = false;
|
// this.isLoggedIn = false;
|
||||||
}
|
// }
|
||||||
if (
|
// if (
|
||||||
this.isLoggedIn === false &&
|
// this.isLoggedIn === false &&
|
||||||
(event as NavigationEnd).url != '/register'
|
// (event as NavigationEnd).url != '/register'
|
||||||
) {
|
// ) {
|
||||||
this.router.navigate(['/login']);
|
// this.router.navigate(['/login']);
|
||||||
}
|
// }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ body {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
background-color: #181a1b;
|
background-color: #181a1b;
|
||||||
|
color: white;
|
||||||
}
|
}
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user