package com.dahe.dispatch.utils

import android.content.Context
import com.dahe.pass.utils.SPUtils
import com.umeng.message.PushAgent

class UserUtils private constructor(){

    companion object{
        val instance = Holder.holder
    }

    object Holder {
        val holder = UserUtils()
    }

    fun loginOut(context : Context){
        if (null== SPUtils.getUserInfo(context))
            return
        PushAgent.getInstance(context).deleteAlias(SPUtils.getUserInfo(context).userInfo.userId,"uid"){ b, s ->  }
        SPUtils.cleanUserInfo(context)
//        val intent = Intent(context, LauncherActivity::class.java)
//        intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK
//        context.startActivity(intent)
//        ToastUtils.showToast(context, "您的账号再异地登录，请重新登录")
    }
}