|
@@ -200,6 +200,7 @@ class LoginActivity : BaseMVVMActivity<ActivityLoginBinding, LoginViewModel>(),
|
|
|
} else {
|
|
|
User.savePhone(binding.username.text.toString().trim())
|
|
|
User.saveToken(it!!)
|
|
|
+ getEvalUserInfo()
|
|
|
JumpUtil.jumpActivityWithBoolean(RouterUrlCommon.evaluation, ck, mContext)
|
|
|
}
|
|
|
}
|
|
@@ -235,6 +236,7 @@ class LoginActivity : BaseMVVMActivity<ActivityLoginBinding, LoginViewModel>(),
|
|
|
}else {
|
|
|
User.savePhone(binding.username.text.toString().trim())
|
|
|
User.saveToken(it!!)
|
|
|
+ getEvalUserInfo()
|
|
|
JumpUtil.jumpActivityWithBoolean(RouterUrlCommon.evaluation, ck, mContext)
|
|
|
}
|
|
|
|
|
@@ -242,9 +244,10 @@ class LoginActivity : BaseMVVMActivity<ActivityLoginBinding, LoginViewModel>(),
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
override fun onResume() {
|
|
|
super.onResume()
|
|
|
if (User.getPhone().isEmpty().not()) {
|
|
@@ -308,6 +311,28 @@ class LoginActivity : BaseMVVMActivity<ActivityLoginBinding, LoginViewModel>(),
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 登录完成获取用户信息
|
|
|
+ */
|
|
|
+ private fun getEvalUserInfo() {
|
|
|
+ viewModel.getUserInfo(fail = {
|
|
|
+ it.toast()
|
|
|
+ }, success = {
|
|
|
+ runOnUiThread {
|
|
|
+ if (it != null) {
|
|
|
+ //保存用户名
|
|
|
+ if (TextUtils.isEmpty(it.name).not()) {
|
|
|
+ User.saveName(it.name)
|
|
|
+ }
|
|
|
+ User.saveUserSex(it.getSex())
|
|
|
+ User.saveUserAge(it.getAgeInfo())
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@SuppressLint("ClickableViewAccessibility")
|
|
|
override fun onTouch(v: View, event: MotionEvent): Boolean {
|
|
|
when (event.action) {
|