|
|
@@ -284,29 +284,32 @@ class HospitalActivity : BaseTvMVVMActivity<ActivityHospitalBinding, HospitalVie
|
|
|
viewModel.getUserInfo(fail = {
|
|
|
it.toast()
|
|
|
}, success = {
|
|
|
- if (it != null) {
|
|
|
- if (TextUtils.isEmpty(it.mobile).not()) {
|
|
|
- User.saveMobile(it.mobile)
|
|
|
- }
|
|
|
- if (TextUtils.isEmpty(it.idCard).not()) {
|
|
|
- User.saveIdCard(it.idCard)
|
|
|
- }
|
|
|
- //保存用户头像
|
|
|
- if (TextUtils.isEmpty(it.avatar).not()) {
|
|
|
- User.saveAvatar(it.avatar)
|
|
|
- }
|
|
|
- //保存用户名
|
|
|
- if (TextUtils.isEmpty(it.name).not()) {
|
|
|
- User.saveName(it.name)
|
|
|
- }
|
|
|
- if (TextUtils.isEmpty(it.orgCode).not()) {
|
|
|
- User.saveOrgCode(it.orgCode)
|
|
|
- }
|
|
|
- User.saveUserSex(it.getSex())
|
|
|
- User.saveUserAge(it.getAgeInfo())
|
|
|
- if (TextUtils.isEmpty(it.id).not()) {
|
|
|
- User.saveUserId(it.id)
|
|
|
+ runOnUiThread {
|
|
|
+ if (it != null) {
|
|
|
+ if (TextUtils.isEmpty(it.mobile).not()) {
|
|
|
+ User.saveMobile(it.mobile)
|
|
|
+ }
|
|
|
+ if (TextUtils.isEmpty(it.idCard).not()) {
|
|
|
+ User.saveIdCard(it.idCard)
|
|
|
+ }
|
|
|
+ //保存用户头像
|
|
|
+ if (TextUtils.isEmpty(it.avatar).not()) {
|
|
|
+ User.saveAvatar(it.avatar)
|
|
|
+ }
|
|
|
+ //保存用户名
|
|
|
+ if (TextUtils.isEmpty(it.name).not()) {
|
|
|
+ User.saveName(it.name)
|
|
|
+ }
|
|
|
+ if (TextUtils.isEmpty(it.orgCode).not()) {
|
|
|
+ User.saveOrgCode(it.orgCode)
|
|
|
+ }
|
|
|
+ User.saveUserSex(it.getSex())
|
|
|
+ User.saveUserAge(it.getAgeInfo())
|
|
|
+ if (TextUtils.isEmpty(it.id).not()) {
|
|
|
+ User.saveUserId(it.id)
|
|
|
+ }
|
|
|
}
|
|
|
+ showTaskFragment()
|
|
|
}
|
|
|
})
|
|
|
}
|