import { Component, OnInit, Inject } from "@angular/core";
import { Router } from "@angular/router";
import { APIService } from "src/app/service/layout/service/api.service";
import { SocialService, ITokenService, DA_SERVICE_TOKEN } from "@delon/auth";
@Component({
  selector: "app-user",
  templateUrl: "./user.component.html",
  styleUrls: ["./user.component.less"]
})
export class UserComponent implements OnInit {
  data = [];
  currentArr = []; // 收起
  remainArr = []; //更多
  constructor(
    private router: Router,
    @Inject(DA_SERVICE_TOKEN) private tokenService: ITokenService,
    private apiSrv: APIService
  ) {}

  ngOnInit() {}
  jumpPassword() {
    this.router.navigateByUrl("/admin/user/password");
  }
  logout() {
    document.cookie="";
    this.apiSrv.logout().subscribe((r: any) => {
      if (r.success == "1") {
        this.tokenService.clear();
        
        this.router.navigateByUrl("/passport/login");
      }
    });
  }
}
