| | |
| | | import androidx.lifecycle.MutableLiveData; |
| | | |
| | | import com.android.app_base.http.ResultData; |
| | | import com.android.app_base.manager.UserManager; |
| | | import com.android.app_base.utils.RxUtils; |
| | | import com.android.app_base.base.viewmodel.BaseViewModel; |
| | | import com.android.app_base.utils.rxbus.MessageEvent; |
| | | import com.android.app_base.utils.rxbus.RxBus; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceAbroadConditionBean; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceAutobiographyBean; |
| | | import com.application.zhangshi_app_android.bean.GrowthExperienceBean; |
| | |
| | | @Override |
| | | public void onNext(ResultData<GrowthExperienceInformationBean> data) { |
| | | if (data.getCode() == CODE_SUCCESS){ |
| | | infoLiveData.postValue(data.getData()); |
| | | GrowthExperienceInformationBean informationBean = data.getData(); |
| | | infoLiveData.postValue(informationBean); |
| | | if(informationBean != null){ |
| | | UserManager.getInstance().setUserName(informationBean.getNickName()); |
| | | UserManager.getInstance().setUserAvatar(informationBean.getImg()); |
| | | RxBus.getInstance().post(new MessageEvent(MessageEvent.EVENT_UPDATE_USER_INFO,informationBean)); |
| | | } |
| | | }else { |
| | | messageLiveData.postValue(data.getMsg()); |
| | | } |