From 5c0d8040266554b67e852ccb7056c3d0cae4b4ef Mon Sep 17 00:00:00 2001 From: fengxiang <110431245@qq.com> Date: Thu, 12 Jul 2018 10:11:10 +0800 Subject: [PATCH] 菜单配置 --- 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..c60c06e 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: '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