fengxiang
2018-07-12 655edbc7405188c4bb32e63bf52a9a31ac00d75c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { SocialService } from '@delon/auth';
 
@Component({
    selector: 'app-callback',
    templateUrl: './callback.component.html',
    providers: [ SocialService ]
})
export class CallbackComponent implements OnInit {
 
    type: string;
 
    constructor(private socialService: SocialService, private route: ActivatedRoute, private router: Router) {}
 
    ngOnInit(): void {
        this.route.params.subscribe(params => {
            this.type = params['type'];
            this.mockModel();
        });
    }
 
    private mockModel() {
        this.socialService.callback({
            token: '123456789',
            name: 'cipchk',
            email: `${this.type}@${this.type}.com`,
            id: 10000,
            time: +new Date
        });
    }
}