package com.guadou.cs_cptservices.router

import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.guadou.cs_cptservices.YYConstants
import com.guadou.cs_router.ARouterPath
import com.guadou.cs_router.service.IServiceComponentServer
import com.guadou.lib_baselib.base.BaseApplication
import com.guadou.lib_baselib.engine.SP
import com.guadou.lib_baselib.ext.checkEmpty
import com.guadou.lib_baselib.engine.getString

@Route(path = ARouterPath.PATH_SERVICE_SERVER, name = "Service模块路由服务")
class ServiceComponentServiceImpl : IServiceComponentServer {

    override fun isUserLogin(): Boolean {
        return !SP().getString(YYConstants.SP_KEY_TOKEN, "").checkEmpty()
    }

    override fun resetLoginStatus() {
        val isLogin = isUserLogin()
        BaseApplication.isUserLogin = isLogin
    }

    override fun init(context: Context?) {
    }

}