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
                      it.appPackage="com.xhkjedu.xh_control_browser"*/
559
                      it.appPackage="com.xhkjedu.xh_control_browser"*/
560
                     LogShow("锁定了吧" + mainLockFlag)
560
                     LogShow("锁定了吧" + mainLockFlag)
561
                     if (!mainLockFlag) {
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
                             spUtils.saveJson(Const.AUTOAPPKEY, it)
563
                             spUtils.saveJson(Const.AUTOAPPKEY, it)
568
                             startAutoApp(it)
564
                             startAutoApp(it)
569
                         } else {
565
                         } else {
612
             )
608
             )
613
             launchIntent.putExtra("authType", autoAppBean.authType)
609
             launchIntent.putExtra("authType", autoAppBean.authType)
614
             userBean?.let {
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
             startActivity(launchIntent)
614
             startActivity(launchIntent)
642
         } catch (e: Exception) {
615
         } catch (e: Exception) {

Loading…
Cancel
Save