Browse Source

1.修改应用拉起时传递的参数。

20241218TB223FC(测试jar包)
wangwanlei 5 months ago
parent
commit
aaa10a6b66

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

@@ -559,11 +559,7 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(), Downloa
559 559
                      it.appPackage="com.xhkjedu.xh_control_browser"*/
560 560
                     LogShow("锁定了吧" + mainLockFlag)
561 561
                     if (!mainLockFlag) {
562
-                        if (it.authUrl != null && AppUtils.isAppInstalled(
563
-                                this@MainActivity,
564
-                                it.appPackage
565
-                            )
566
-                        ) {
562
+                        if (it.authUrl != null && AppUtils.isAppInstalled(this@MainActivity, it.appPackage)) {
567 563
                             spUtils.saveJson(Const.AUTOAPPKEY, it)
568 564
                             startAutoApp(it)
569 565
                         } else {
@@ -612,31 +608,8 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(), Downloa
612 608
             )
613 609
             launchIntent.putExtra("authType", autoAppBean.authType)
614 610
             userBean?.let {
615
-                when (autoAppBean.authType) {
616
-                    1 -> {
617
-                        val userid = it.userid
618
-                        launchIntent.putExtra("authData", userid.toString())
619
-                    }
620
-
621
-                    2 -> {
622
-                        val studentno = it.studentno
623
-                        launchIntent.putExtra("authData", studentno.toString())
624
-                    }
625
-
626
-                    3 -> {
627
-                        val userphone = it.userphone
628
-                        launchIntent.putExtra("authData", userphone.toString())
629
-                    }
630
-
631
-                    4 -> {
632
-                        val cardid = it.cardid
633
-                        launchIntent.putExtra("authData", cardid.toString())
634
-                    }
635
-
636
-                    else -> {
637
-
638
-                    }
639
-                }
611
+                val parseClassToJson = GsonUtils.parseClassToJson(it)
612
+                launchIntent.putExtra("authData", parseClassToJson)
640 613
             }
641 614
             startActivity(launchIntent)
642 615
         } catch (e: Exception) {

Loading…
Cancel
Save