package com.cooleshow.teacher

import android.text.TextUtils
import com.cooleshow.base.common.BaseApplication
import com.alibaba.android.arouter.launcher.ARouter
import com.cooleshow.base.data.net.CommonParamsHelper
import com.cooleshow.base.utils.Utils
import com.cooleshow.usercenter.helper.UserHelper

/**
 * Author by pq, Date on 2022/4/20.
 */
class App : BaseApplication() {
    override fun onCreate() {
        super.onCreate()
        ARouter.init(this)
        Utils.init(this)
        initCommonParams();
    }


    private fun initCommonParams() {
        var userToken = UserHelper.getUserToken()
        if (!TextUtils.isEmpty(userToken)) {
            //添加公共参数
            CommonParamsHelper.getInstance()
                .addCommonHeaderParams(CommonParamsHelper.USER_TOKEN, userToken);
        }
    }

    override fun isTeacherClient(): Boolean {
        return true
    }
}