import { Injectable } from '@angular/core';
import * as Parse from "parse";

@Injectable({
  providedIn: 'root'
})
export class ServiceUserService {

  constructor() { }

  /**
   * 检查用户密码是否正确
   */
  async loginUserPassword(userData: {
    username: string
    password: string
  }) {
    try {
      let user = await Parse.User.logIn(userData.username, userData.password)
      if (user?.id) {
        return true
      }
      return false
    } catch (err) {
      console.error(err)
      return false
    }
  }
}
