增加配置接口;调试人脸识别;验证手机号密码登录和人脸登录功能;

This commit is contained in:
马增飞
2025-12-29 18:41:48 +08:00
parent 6c28260069
commit 17d47a876f
21 changed files with 141 additions and 55 deletions
@@ -149,7 +149,7 @@ class SettingViewModel : BaseViewModel() {
// }
// }
fun unbindPlate(id: Int, block:(Pair<Boolean?, ErrorInfo>)-> Unit) {
fun unbindPlate(id: Long, block:(Pair<Boolean?, ErrorInfo>)-> Unit) {
block(null to ErrorInfo())
launchWithLoading {
val response = repository.plateUnbind(id)
@@ -187,7 +187,7 @@ class SettingViewModel : BaseViewModel() {
launchWithLoading {
// val bindParam = BindParam(plateNumber = plateNumber)
val response = repository.findByPlateNumber(plateNumber)
if (response.code == 200) {
if (response.code == "00000") {
_searchUserInfo.value = response.data
} else {
_searchUserInfo.value = EquipmentUserInfo(
@@ -11,6 +11,7 @@ import com.sw.plate.utils.arcface.facedb.entity.FaceEntity
import com.sw.platecabinet.GlobalData
import com.sw.platecabinet.GlobalData.globalEquipmentCode
import com.sw.platecabinet.GlobalKey
import com.sw.platecabinet.model.DeviceConfig
import com.sw.platecabinet.model.request.LoginParam
import com.sw.platecabinet.model.response.EquipmentUserInfo
import com.sw.platecabinet.model.response.UserFaceModel
@@ -140,7 +141,7 @@ class UserViewModel : BaseViewModel() {
/**
* 通过用户id获取用户信息
*/
fun getUserInfoById(memberId: Int?, action:(EquipmentUserInfo?)->Unit={}) {
fun getUserInfoById(memberId: String?, action:(EquipmentUserInfo?)->Unit={}) {
_currentUserInfo.value = null
launchWithLoading {
val loginParam = LoginParam(memberId = memberId)
@@ -159,5 +160,16 @@ class UserViewModel : BaseViewModel() {
Timber.d("resetUserInfo")
_currentUserInfo.value = null
}
fun getDeviceConfig(block: (DeviceConfig?) -> Unit) {
// Timber.tag(TAG).d("getDeviceConfig")
launch {
val response = repository.getDeviceConfig()
if (parseResponse(response)) {
block(response.data)
} else {
block(null)
}
}
}
}