From 5ff5fdaee98e8b2a0776ee5747292aa08a6b26df Mon Sep 17 00:00:00 2001 From: fengxiang <110431245@qq.com> Date: Wed, 11 Jul 2018 22:01:07 +0800 Subject: [PATCH] 打印ajax结果 --- src/app/app.component.ts | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 7b67a27..73b7f8b 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 { SettingsService, TitleService } from '@delon/theme'; import { filter } from 'rxjs/operators'; +import { DA_SERVICE_TOKEN, TokenService } from '@delon/auth'; @Component({ selector: 'app-root', @@ -25,9 +26,18 @@ private settings: SettingsService, private router: Router, 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)) .subscribe(() => this.titleSrv.setTitle()); -- Gitblit v1.8.0