数据可视化大屏
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

callback.component.ts 828B

1 年之前
12345678910111213141516171819202122232425262728293031323334
  1. import { Component, Input, OnInit, inject } from '@angular/core';
  2. import { SocialService } from '@delon/auth';
  3. import { SettingsService } from '@delon/theme';
  4. @Component({
  5. selector: 'app-callback',
  6. template: ``,
  7. providers: [SocialService],
  8. standalone: true
  9. })
  10. export class CallbackComponent implements OnInit {
  11. private readonly socialService = inject(SocialService);
  12. private readonly settingsSrv = inject(SettingsService);
  13. @Input() type = '';
  14. ngOnInit(): void {
  15. this.mockModel();
  16. }
  17. private mockModel(): void {
  18. const info = {
  19. token: '123456789',
  20. name: 'cipchk',
  21. email: `${this.type}@${this.type}.com`,
  22. id: 10000,
  23. time: +new Date()
  24. };
  25. this.settingsSrv.setUser({
  26. ...this.settingsSrv.user,
  27. ...info
  28. });
  29. this.socialService.callback(info);
  30. }
  31. }