import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';

import * as Parse from "parse"
(Parse as any).serverURL = "https://web2023.fmode.cn/parse"
Parse.initialize("dev")

@Component({
  selector: 'app-login',
  templateUrl: './login.page.html',
  styleUrls: ['./login.page.scss'],
})
export class LoginPage implements OnInit {
  username:string | undefined
  password:string | undefined

  constructor(private router: Router) {}


  async doLogin(){
    try {
      let user = await Parse.User.logIn(String(this.username), String(this.password))
      this.router.navigate(['/tabs']);
      console.log('登录成功');
      
    } catch (error) {
      console.log(error);
    }
    
  }
  goRegister(){
    this.router.navigate(['/register']);
  }
  ngOnInit() {
  }

}
