| | |
| | | } else { |
| | | if (getToken().isNullOrEmpty()) { |
| | | Handler(Looper.getMainLooper()).post { |
| | | toast("开始登录") |
| | | // toast("开始登录") |
| | | } |
| | | var driverCertificate = intent.getStringExtra("driverCertificate") |
| | | if (driverCertificate == null) { |
| | |
| | | |
| | | private fun toLoginActivity(context: Context?, driverCertificate: String?) { |
| | | var map = getMapByAny() |
| | | map["identification"] = driverCertificate |
| | | callNet(context!!, Api.loginByIdentification, map) { |
| | | if (driverCertificate.isNullOrEmpty()){ |
| | | toast("资格证号:空") |
| | | return |
| | | } |
| | | 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()) |