From 650dd2e2ad74da52fbd273fbfbfd34d02d216b3e Mon Sep 17 00:00:00 2001 From: chenjuntao Date: Tue, 16 Jan 2024 14:43:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20V5.32.8=E5=AE=9E=E5=90=8D=E8=AE=A4?= =?UTF-8?q?=E8=AF=81=E9=97=AE=E9=A2=98=20https://jira.shanqu.cc/browse/GHZ?= =?UTF-8?q?S-4567?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chenjuntao --- .../fragment/user/RealNameInfoViewModel.kt | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/halo/assistant/fragment/user/RealNameInfoViewModel.kt b/app/src/main/java/com/halo/assistant/fragment/user/RealNameInfoViewModel.kt index 17719ef2a0..9b1af1f476 100644 --- a/app/src/main/java/com/halo/assistant/fragment/user/RealNameInfoViewModel.kt +++ b/app/src/main/java/com/halo/assistant/fragment/user/RealNameInfoViewModel.kt @@ -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)