2016-05-09 23:04:56 +08:00
|
|
|
import {Component, ViewEncapsulation} from "@angular/core";
|
2016-12-27 06:36:38 +08:00
|
|
|
import {RouterLink} from "@angular/router";
|
2016-05-17 05:15:03 +08:00
|
|
|
import {AuthenticationService} from "../model/network/authentication.service";
|
2016-12-27 23:09:47 +08:00
|
|
|
import {UserDTO} from "../../../common/entities/UserDTO";
|
2016-07-07 18:19:08 +08:00
|
|
|
import {Config} from "../config/Config";
|
2016-05-09 23:04:56 +08:00
|
|
|
|
2016-04-26 21:10:05 +08:00
|
|
|
@Component({
|
|
|
|
selector: 'app-frame',
|
2016-05-09 23:04:56 +08:00
|
|
|
templateUrl: 'app/frame/frame.component.html',
|
2016-12-27 06:36:38 +08:00
|
|
|
providers: [RouterLink],
|
2016-04-26 21:10:05 +08:00
|
|
|
encapsulation: ViewEncapsulation.Emulated
|
|
|
|
})
|
2016-05-09 23:04:56 +08:00
|
|
|
export class FrameComponent {
|
|
|
|
|
2016-12-27 23:09:47 +08:00
|
|
|
user: UserDTO;
|
2016-07-07 18:19:08 +08:00
|
|
|
authenticationRequired:boolean = false;
|
2016-05-17 05:15:03 +08:00
|
|
|
|
|
|
|
constructor(private _authService:AuthenticationService) {
|
|
|
|
this.user = this._authService.getUser();
|
2016-07-07 18:19:08 +08:00
|
|
|
this.authenticationRequired = Config.Client.authenticationRequired;
|
2016-05-17 05:15:03 +08:00
|
|
|
}
|
2016-05-01 16:28:05 +08:00
|
|
|
|
2016-07-07 18:19:08 +08:00
|
|
|
|
2016-05-17 05:15:03 +08:00
|
|
|
logout() {
|
|
|
|
this._authService.logout();
|
|
|
|
}
|
|
|
|
|
2016-04-26 21:10:05 +08:00
|
|
|
}
|
|
|
|
|