package com.rdiot.yx485.ui.login.model

import com.rdiot.yx485.base.LocalData
import kotlinx.serialization.Serializable

/**
 * 记录用户登录信息，用于退出后登录（保存密码）
 * @author mR2hao
 * @date 2022/12/21
 */
@Serializable
data class LoginRecord(val phone: String?, val pwd: String?, val loginType: LoginType) :
    java.io.Serializable {

    fun save(): LoginRecord {
        LocalData.lastLoginRecord = this
        return this
    }

    companion object {
        private const val serialVersionUID = -21L
    }
}

enum class LoginType {
    SMS,
    PWD
}