package com.adealink.weparty.account.login.manager

import com.adealink.frame.util.AppUtil
import com.adealink.weparty.account.login.auth.AuthManager
import com.adealink.weparty.config.globalConfigManager
import com.adealink.weparty.module.account.AccountLocalService
import com.adealink.weparty.storage.AppPref

/**
 * 处理用户退出登录时的清理操作
 * Created by XiaoDongLin.
 * Date: 2025/3/4
 */
object LogoutCleaner {

    fun clean() {
        AppPref.needRegister = true
        AppPref.refreshToken = ""
        AppPref.imToken = ""
        val authType = AccountLocalService.loginType
        AppUtil.currentActivity?.let {
            AuthManager(null).logout(authType, it)
        }
        AccountLocalService.loginType = ""
        globalConfigManager.logout()

        //模块执行退登清理

    }
}