package com.sd.geelyhmiweb.viewmodels

import android.content.Context
import android.text.TextUtils
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.sd.geelyhmiweb.respositys.LoginRepo
import com.sd.geelyhmiweb.utils.ToastHelper
import dagger.hilt.android.lifecycle.HiltViewModel
import dagger.hilt.android.qualifiers.ApplicationContext
import javax.inject.Inject

@HiltViewModel
class LoginVM @Inject constructor(
//    private var loginRepo: LoginRepo,
    @ApplicationContext var context: Context
) : ViewModel() {

    fun login(userName: String, pwd: String): LiveData<Boolean> {
        var data = MutableLiveData(false)
//        if (TextUtils.isEmpty(userName)) {
//            ToastHelper.showShort(context, " 请输入账号")
//        }
//        if (TextUtils.isEmpty(pwd)) {
//            ToastHelper.showShort(context, " 请输入密码")
//        }
        data.value = true
        return data
    }
}