Browse Source

1.优化应用拉起逻辑,只有在autoapp请求失败时才请求缓存的拉起数据,不然根据接口的数据处理。

20241218TB223FC(测试jar包)
wangwanlei 4 months ago
parent
commit
79d17637bc

+ 13
- 7
app/src/main/java/com/xhly/manageapp/ui/main/activity/MainActivity.kt View File

558
                     /* it.authUrl="com.xhkjedu.xh_control_browser.MainActivity"
558
                     /* it.authUrl="com.xhkjedu.xh_control_browser.MainActivity"
559
                      it.appPackage="com.xhkjedu.xh_control_browser"*/
559
                      it.appPackage="com.xhkjedu.xh_control_browser"*/
560
                     LogShow("锁定了吧" + mainLockFlag)
560
                     LogShow("锁定了吧" + mainLockFlag)
561
+                    //未锁定则执行跳转,锁定则跳转主页再次锁定并且不在请求接口
561
                     if (!mainLockFlag) {
562
                     if (!mainLockFlag) {
562
-                        if (it.authUrl != null && AppUtils.isAppInstalled(this@MainActivity, it.appPackage)) {
563
-                            spUtils.saveJson(Const.AUTOAPPKEY, it)
564
-                            startAutoApp(it)
565
-                        } else {
566
-                            try {
563
+                        //如果地址为空并且请求为true则不跳转,否则跳转
564
+                        try {
565
+                            if ((it.authUrl.isNullOrEmpty()||it.appPackage.isNullOrEmpty())&&it.netSucessFlag){
566
+                                canClickFlag = true
567
+                                autoAppFlag = false
568
+                                spUtils.saveJson(Const.AUTOAPPKEY, it)
569
+                            } else if ((!it.authUrl.isNullOrEmpty()&&!it.appPackage.isNullOrEmpty()) && AppUtils.isAppInstalled(this@MainActivity, it.appPackage)) {
570
+                                spUtils.saveJson(Const.AUTOAPPKEY, it)
571
+                                startAutoApp(it)
572
+                            } else if (!it.netSucessFlag){
567
                                 val autoAppBean = spUtils.getFromJson(
573
                                 val autoAppBean = spUtils.getFromJson(
568
                                     Const.AUTOAPPKEY,
574
                                     Const.AUTOAPPKEY,
569
                                     AutoAppBean().javaClass
575
                                     AutoAppBean().javaClass
577
                                 } else {
583
                                 } else {
578
                                     canClickFlag = true
584
                                     canClickFlag = true
579
                                 }
585
                                 }
580
-                            } catch (e: Exception) {
581
-                                canClickFlag = true
582
                             }
586
                             }
587
+                        } catch (e: Exception) {
588
+                            canClickFlag = true
583
                         }
589
                         }
584
                     } else {
590
                     } else {
585
                         canClickFlag = true
591
                         canClickFlag = true

Loading…
Cancel
Save