From 94e6ca608b417da5eb051d1c5e94c31388da9369 Mon Sep 17 00:00:00 2001
From: fengxiang <110431245@qq.com>
Date: Thu, 12 Jul 2018 10:15:36 +0800
Subject: [PATCH] token 完善
---
src/app/app.component.ts | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/src/app/app.component.ts b/src/app/app.component.ts
index c1ba478..acc7507 100644
--- a/src/app/app.component.ts
+++ b/src/app/app.component.ts
@@ -1,7 +1,8 @@
-import { Component, HostBinding, OnInit } from '@angular/core';
+import { Component, HostBinding, OnInit, Inject } from '@angular/core';
import { Router, NavigationEnd } from '@angular/router';
import { ThemesService, SettingsService, TitleService } from '@delon/theme';
import { filter, map } from 'rxjs/operators';
+import { TokenService, DA_SERVICE_TOKEN } from '@delon/auth';
@Component({
selector: 'app-root',
@@ -17,10 +18,20 @@
private theme: ThemesService,
private settings: SettingsService,
private router: Router,
- private titleSrv: TitleService) {
+ private titleSrv: TitleService,
+ @Inject(DA_SERVICE_TOKEN) private tokenService: TokenService,
+ ) {
}
ngOnInit() {
+ // ������Token������
+ this.tokenService.set({
+ token: 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsIm9pZCI6NSwibW9kZSI6IldlYiIsInNjb3BlcyI6WyJ0ZW1wIl0sImlzcyI6Imh0dHA6Ly9tb25pdG9yLjdkcmxiLmNvbSIsImlhdCI6MTUzMTMxNjU4MCwiZXhwIjoxNTM5MDkyNTgwfQ.tWE7AqGfLwwK-nO1FUveJ8xKqpxitqG1GdhKHp9JDyRPjNDYX7ocgkEw0W2G8hKL_tJIjjrQ1pc0zvCmLTJ-pg',
+ name: 'admin',
+ email: `admin@qq.com`,
+ id: 10000,
+ time: +new Date(),
+ });
this.router.events.pipe(
filter(evt => evt instanceof NavigationEnd),
map(() => this.router.url)
--
Gitblit v1.8.0