package com.cooleshow.teacher.ui.splash

import com.alibaba.android.arouter.launcher.ARouter
import com.cooleshow.base.router.RouterPath
import com.cooleshow.base.ui.activity.BaseActivity
import com.cooleshow.teacher.databinding.ActivitySplashLayoutBinding
import com.cooleshow.usercenter.helper.UserHelper


/**
 * Author by pq, Date on 2022/4/19.
 */
class SplashActivity : BaseActivity<ActivitySplashLayoutBinding>() {
    override fun getLayoutView(): ActivitySplashLayoutBinding {
        return ActivitySplashLayoutBinding.inflate(layoutInflater)
    }

    override fun initView() {

    }

    override fun initData() {
        super.initData()
        if (UserHelper.isLogin()) {
            jumpMain()
        } else {
            jumpLogin()
        }
        finish()
    }

    private fun jumpMain() {
        ARouter.getInstance().build(RouterPath.APPCenter.PATH_HOME).navigation()
    }

    private fun jumpLogin() {
        ARouter.getInstance().build(RouterPath.UserCenter.PATH_VERIFY_LOGIN).navigation()
    }

}