From 40a8a2c243c15fe8d4eb46f4dbc42a290bd0a63a Mon Sep 17 00:00:00 2001 From: liugl <liugl@sinata.cn> Date: 星期四, 10 九月 2020 15:34:08 +0800 Subject: [PATCH] 9.10 --- app/src/main/java/com/okgoincar/base/MainBroadCastReceiver.kt | 33 ++++++++++++++++++++++++++++++--- 1 files changed, 30 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/okgoincar/base/MainBroadCastReceiver.kt b/app/src/main/java/com/okgoincar/base/MainBroadCastReceiver.kt index ff3fc27..711e4cf 100644 --- a/app/src/main/java/com/okgoincar/base/MainBroadCastReceiver.kt +++ b/app/src/main/java/com/okgoincar/base/MainBroadCastReceiver.kt @@ -67,13 +67,40 @@ } } +// private fun toLoginActivity(context: Context?, driverCertificate: String?) { +// var map = getMapByAny() +// map["identification"] = driverCertificate +// callNet(context!!, Api.loginByIdentification, map) { +// toast("登录成功") +// var bean = Gson().fromJson<LoginBean>(it, LoginBean::class.java) +// CacheKey.putKeyStr("identification", driverCertificate!!) +// CacheKey.putKeyStr("appid", bean.data.appid) +// CacheKey.putKeyStr("token", bean.data.token) +// CacheKey.putKeyStr("userId", bean.data.id.toString()) +// CacheKey.putKeyStr("serverId", bean.data.serverId.toString()) +// CacheKey.putKeyStr("terminalName", bean.data.terminalId.toString()) +// Handler(Looper.getMainLooper()).post { +// var intent = Intent() +// intent.setClass(context, SlabMainActivity::class.java) +// intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK +// context.startActivity(intent) +// } +// } +// } + private fun toLoginActivity(context: Context?, driverCertificate: String?) { var map = getMapByAny() - map["identification"] = driverCertificate - callNet(context!!, Api.loginByIdentification, map) { + if (driverCertificate.isNullOrEmpty()){ +// toast("资格证号:空") + return + }else{ +// toast("资格证号:"+driverCertificate) + } + map["taxiAptitudeCard"] = driverCertificate + callNet(context!!, Api.loginByTaxiAptitudeCard, map) { toast("登录成功") var bean = Gson().fromJson<LoginBean>(it, LoginBean::class.java) - CacheKey.putKeyStr("identification", driverCertificate!!) + CacheKey.putKeyStr("identification", driverCertificate) CacheKey.putKeyStr("appid", bean.data.appid) CacheKey.putKeyStr("token", bean.data.token) CacheKey.putKeyStr("userId", bean.data.id.toString()) -- Gitblit v1.7.1