|
@@ -2,10 +2,12 @@ package com.example.chemical.ui.login
|
|
|
|
|
|
|
|
|
import android.os.*
|
|
|
+import android.util.Log
|
|
|
import android.view.LayoutInflater
|
|
|
import android.view.MotionEvent
|
|
|
import android.view.View
|
|
|
import android.widget.TextView
|
|
|
+import com.blankj.utilcode.util.LogUtils
|
|
|
import com.bumptech.glide.Glide
|
|
|
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
|
|
import com.bumptech.glide.request.RequestOptions
|
|
@@ -80,9 +82,11 @@ class FacialLoginActivity : BaseCountDownActivity<ActivityFacialLoginBinding>()
|
|
|
"1" -> {
|
|
|
viewBinding.linType.visibility = View.GONE
|
|
|
}
|
|
|
+
|
|
|
"4" -> {
|
|
|
viewBinding.tvScan.visibility = View.GONE
|
|
|
}
|
|
|
+
|
|
|
"5" -> {
|
|
|
viewBinding.tvSwipe.visibility = View.GONE
|
|
|
}
|
|
@@ -93,7 +97,7 @@ class FacialLoginActivity : BaseCountDownActivity<ActivityFacialLoginBinding>()
|
|
|
}
|
|
|
|
|
|
val map = mutableMapOf<String, String>()
|
|
|
- if (mtypes!=null){
|
|
|
+ if (mtypes != null) {
|
|
|
map["mtypes"] = mtypes
|
|
|
}
|
|
|
if (str != null && str.length > 0) {
|
|
@@ -225,7 +229,9 @@ class FacialLoginActivity : BaseCountDownActivity<ActivityFacialLoginBinding>()
|
|
|
val disposable = ApiRepository.faceCompare(featureData, param)
|
|
|
.subscribe({ success ->
|
|
|
dismissLoading()
|
|
|
+ LogUtils.json(success)
|
|
|
ChemicalApp.userData = success
|
|
|
+ LogUtils.d(success.userId, ChemicalApp.subjectId)
|
|
|
authenticationInfo(success.userId, ChemicalApp.subjectId!!)
|
|
|
}, { throwable ->
|
|
|
dismissLoading()
|
|
@@ -236,9 +242,11 @@ class FacialLoginActivity : BaseCountDownActivity<ActivityFacialLoginBinding>()
|
|
|
|
|
|
//验证当前人员身份
|
|
|
private fun authenticationInfo(userId: String, subId: String) {
|
|
|
+ LogUtils.d(userId, subId)
|
|
|
showLoading("验证中...")
|
|
|
val disposable = ApiRepository.userCardValidation(userId, subId)
|
|
|
.subscribe({ data ->
|
|
|
+ LogUtils.json(data)
|
|
|
dismissLoading()
|
|
|
val allFalse = with(data) {
|
|
|
cabinetAdmin == false &&
|
|
@@ -367,6 +375,7 @@ class FacialLoginActivity : BaseCountDownActivity<ActivityFacialLoginBinding>()
|
|
|
* 异常处理
|
|
|
*/
|
|
|
private fun throwableView(throwable: Throwable) {
|
|
|
+ LogUtils.e(Log.getStackTraceString(throwable))
|
|
|
when (throwable) {
|
|
|
is NetException -> {
|
|
|
if (throwable.message.isNullOrEmpty()) {
|
|
@@ -375,10 +384,11 @@ class FacialLoginActivity : BaseCountDownActivity<ActivityFacialLoginBinding>()
|
|
|
throwable.message!!
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
is SocketTimeoutException -> "请求超时,请稍后重试"
|
|
|
is ConnectException -> "无法连接服务器,请检查网络"
|
|
|
is HttpException -> "服务器繁忙,请稍后重试"
|
|
|
- else -> null
|
|
|
+ else -> "服务器异常"
|
|
|
}?.let { customDialogView(2, "$it") }
|
|
|
}
|
|
|
|