Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
This commit is contained in:
chenjuntao
2024-01-16 14:43:04 +08:00
parent 563955940d
commit 650dd2e2ad

View File

@ -101,16 +101,11 @@ class RealNameInfoViewModel(application: Application) : AndroidViewModel(applica
val cachedUserInfo =
UserRepository.getInstance().cacheUserInfoEntity
// 登录状态下更新实名认证信息
if (cachedUserInfo != null) {
cachedUserInfo.idCard = content.toObject()
UserRepository.getInstance()
.cacheAndNotifyUserInfo(cachedUserInfo, true)
}
var isUnQualified = false
tryWithDefaultCatch {
val `object` = JSONObject(data?.string() ?: "")
val isUnQualified = `object`.getBoolean("minor")
isUnQualified = `object`.getBoolean("minor")
var qualifyInt = 1
if (!isUnQualified) {
qualifyInt = 2
@ -125,6 +120,17 @@ class RealNameInfoViewModel(application: Application) : AndroidViewModel(applica
)
}
// 登录状态下更新实名认证信息
if (cachedUserInfo != null && data?.string() != null) {
val newIdCard: IdCardEntity? = content.toObject()
if (isUnQualified) {
newIdCard?.minor = true
}
cachedUserInfo.idCard = newIdCard
UserRepository.getInstance()
.cacheAndNotifyUserInfo(cachedUserInfo, true)
}
DataUtils.getDeviceCertification(HaloApp.getInstance().gid)
certificateResultLiveData.postValue(RESULT_SUCCESS)