app/src/main/java/cn/flightfeather/thirdapp/CommonApplication.java
@@ -16,7 +16,10 @@
import cn.flightfeather.thirdapp.bean.entity.Userinfo;
import cn.flightfeather.thirdapp.common.net.RetrofitFactory;
import cn.flightfeather.thirdapp.util.GlobalConfig;
import cn.flightfeather.thirdapp.util.crashreport.MyCrashHandler;
import cn.flightfeather.thirdapp.util.notification.MyNotificationChannel;
import cn.flightfeather.thirdapp.util.push.PushService;
import cn.flightfeather.thirdapp.util.tbs.Tbs;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
@@ -55,6 +58,12 @@
        //x5内核初始化
        Tbs.Companion.init(this);
        //Android8.0后注册通知通道
        MyNotificationChannel.Companion.init(this);
        //初始化移动推送
        PushService.Companion.init(this);
        if (instance == null) {
            instance = this;
@@ -155,12 +164,18 @@
    public Userinfo getCurrentUser() {
        if (currentUser ==null){
            userinfoDao = this.getDaoSession().getUserinfoDao();
            currentUser = userinfoDao.queryBuilder().unique();
            String userId = GlobalConfig.Companion.getInstance().getUserId();
            if (userId == null) {
                currentUser = userinfoDao.queryBuilder().unique();
            } else {
                currentUser = userinfoDao.queryBuilder().where(UserinfoDao.Properties.Guid.eq(userId)).unique();
            }
        }
        return currentUser;
    }
    public void setCurrentUser(Userinfo currentUser) {
        GlobalConfig.Companion.getInstance().setUserId(currentUser.getGuid());
        this.currentUser = currentUser;
    }