package com.swago.app

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.activity.viewModels
import com.alibaba.android.arouter.launcher.ARouter
import com.swago.baseswago.constant.ARouteConstant

import com.swago.baseswago.util.UserInfo

class SplashActivity : AppCompatActivity() {

    private val splashVm by viewModels<SplashVm>()

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_splash)

        if (UserInfo.getLoginModel() == null){
            ARouter.getInstance().build(ARouteConstant.Login.login).navigation()
            finish()
        }else{
            splashVm.loginByAuto()
        }

    }


}