import { Component, OnInit } from '@angular/core';
import { ApiService } from '../../service/api.service';
import { TransferService } from '../../service/transfer.service';

@Component({
  selector: 'app-page-four',
  templateUrl: './page-four.component.html',
  styleUrls: ['./page-four.component.scss'],
})
export class PageFourComponent implements OnInit {

  req: any = {};
  resp: any = '';
  constructor(private api: ApiService, private tf: TransferService) { }

  ngOnInit() {}

  getSelfInfo() {
    const req = {
      userName: this.req.name,
      password: this.req.ps
    };
    this.api.user.getSelfInfo([req, (data) => {
      if (data) {
        console.log(data);
        this.resp = JSON.stringify(data);
      } else {
        this.api.presentMsgToast(data && data.message ? data.message : '登录失败');
      }
    }]);
  }
}
