From 66d9ccf38814e8199b4ed2335c8c2d183b676380 Mon Sep 17 00:00:00 2001 From: tanghao <405676538@qq.com> Date: 星期二, 17 一月 2023 12:02:52 +0800 Subject: [PATCH] 1。4:处理预约单导致串单的问题 隐藏预约单 二次修改为测试环境 --- app/src/main/java/com/okgoincar/base/MainBroadCastReceiver.kt | 68 +++++++++++++++++----------------- 1 files changed, 34 insertions(+), 34 deletions(-) diff --git a/app/src/main/java/com/okgoincar/base/MainBroadCastReceiver.kt b/app/src/main/java/com/okgoincar/base/MainBroadCastReceiver.kt index baad814..8c58ed5 100644 --- a/app/src/main/java/com/okgoincar/base/MainBroadCastReceiver.kt +++ b/app/src/main/java/com/okgoincar/base/MainBroadCastReceiver.kt @@ -23,40 +23,40 @@ class MainBroadCastReceiver : BroadcastReceiver() { override fun onReceive(contexts: Context?, intent: Intent?) { -// if (intent == null) { -// toast("内容获取为空,广播接收消息错误") -// return -// } -// try { -// Handler(Looper.getMainLooper()).post { -// val b = intent.getBooleanExtra("isLogin", true) -// if (!b) { -// loginOut(contexts) -// CacheUtil.get().clear() -// EventBus.getDefault().post(BaseEvent(BaseEvent.OUT_APP)) -// } else { -// if (getToken().isNullOrEmpty()) { -// Handler(Looper.getMainLooper()).post { -//// toast("开始登录") -// } -// var driverCertificate = intent.getStringExtra("driverCertificate") -// if (driverCertificate == null) { -//// toast("身份证获取失败") -// } else { -// if (contexts == null) { -//// toast("上下文为空,使用全局跳转") -// toLoginActivity(MyApplication.getInstance(), driverCertificate) -// } else { -// toLoginActivity(MyApplication.getInstance(), driverCertificate) -// } -// } -// -// } -// } -// } -// } catch (e: Exception) { -// -// } + if (intent == null) { + toast("内容获取为空,广播接收消息错误") + return + } + try { + Handler(Looper.getMainLooper()).post { + val b = intent.getBooleanExtra("isLogin", true) + if (!b) { + loginOut(contexts) + CacheUtil.get().clear() + EventBus.getDefault().post(BaseEvent(BaseEvent.OUT_APP)) + } else { + if (getToken().isNullOrEmpty()) { + Handler(Looper.getMainLooper()).post { +// toast("开始登录") + } + var driverCertificate = intent.getStringExtra("driverCertificate") + if (driverCertificate == null) { +// toast("身份证获取失败") + } else { + if (contexts == null) { +// toast("上下文为空,使用全局跳转") + toLoginActivity(MyApplication.getInstance(), driverCertificate) + } else { + toLoginActivity(MyApplication.getInstance(), driverCertificate) + } + } + + } + } + } + } catch (e: Exception) { + + } } -- Gitblit v1.7.1