|
|
@@ -15,6 +15,7 @@ import com.yingyangfly.baselib.ext.toast
|
|
|
import com.yingyangfly.baselib.mvvm.BaseMVVMActivity
|
|
|
import com.yingyangfly.baselib.router.RouterUrlCommon
|
|
|
import com.yingyangfly.baselib.utils.JumpUtil
|
|
|
+import com.yingyangfly.baselib.utils.User
|
|
|
|
|
|
/**
|
|
|
* 个人中心
|
|
|
@@ -62,6 +63,19 @@ class PersonalCenterActivity :
|
|
|
}, success = {
|
|
|
if (it != null) {
|
|
|
binding.data = it
|
|
|
+ //保存用户头像
|
|
|
+ if (it.avatar.isEmpty().not()) {
|
|
|
+ User.saveAvatar(it.avatar)
|
|
|
+ }
|
|
|
+ //保存用户名
|
|
|
+ if (it.name.isEmpty().not()) {
|
|
|
+ User.saveName(it.name)
|
|
|
+ }
|
|
|
+ User.saveUserSex(it.getSex())
|
|
|
+ User.saveUserAge(it.getAgeInfo())
|
|
|
+ if (it.id.isEmpty().not()) {
|
|
|
+ User.saveUserId(it.id)
|
|
|
+ }
|
|
|
if (it.diagnoseResult.isNullOrEmpty().not()) {
|
|
|
diagnosisList.addAll(it.diagnoseResult)
|
|
|
}
|