This commit is contained in:
2025-12-09 18:38:26 +08:00
parent 086845dd16
commit 88d7530568
9 changed files with 67 additions and 42 deletions
@@ -98,8 +98,12 @@ class UserViewModel : BaseViewModel() {
SPUtil.getInstance().put(GlobalKey.KEY_FIRST_RUN, true)
withContext(Dispatchers.Default) {
val list: List<UserFaceModel> = response.data ?: emptyList()
val item = list.firstOrNull { it.userId == "1951105919342936066" }
Timber.tag(TAG).d("getUserFaceCache userId = ${item?.userId}")
if (list.isEmpty()) {
ToastUtils.showToast("查询人脸数据为空")
return@withContext
}
// val item = list.firstOrNull { it.userId == "1951105919342936066" }
// Timber.tag(TAG).d("getUserFaceCache userId = ${item?.userId}")
val faceEntity = list.map {
FaceEntity(it.userId, null, Base64.decode(it.faceFeatureStr))
}
@@ -384,7 +388,14 @@ class UserViewModel : BaseViewModel() {
Timber.tag(TAG).d("queryOrderState")
val response = repository.queryOrderState(orderNo = orderId)
if (parseResponse(response)) {
val orderState = response.data == "1"
val respData = response.data as? String
?: if (response.data is Any) {
GsonUtils.toJson(response.data)
} else {
""
}
val payResult = GsonUtils.fromJson(respData, PayResult::class.java)
val orderState = payResult?.paySuc == "1"
block(orderState)
} else {
block(false)