Bladeren bron

1.添加UserName常量。

20241218TB223FC(测试jar包)
wangwanlei 9 maanden geleden
bovenliggende
commit
413d9c6f43

+ 2
- 2
app/src/main/java/com/xhly/manageapp/service/websocket/AppSocket.kt Bestand weergeven

@@ -75,8 +75,8 @@ class AppSocket : SocketClient() {
75 75
             MD5Utils.getJsMD5(webData.code.toString() + "_" + webData.mid + "_" + webData.timeunix.toString())
76 76
         webData.sign = MD5Utils.getJsMD5(jsMD5)
77 77
         val socketUserBean = WebSocketUserBean()
78
-        socketUserBean.usertype = 1
79
-        socketUserBean.username = "测试"
78
+        socketUserBean.usertype = 2
79
+        socketUserBean.username = Const.USERNAME
80 80
         socketUserBean.userid = ManageApplication.getDeviceInfo()
81 81
         webData.body = socketUserBean
82 82
         WebSocketHelper.getInstance().sendSocketString(GsonUtils.parseClassToJson(webData))

+ 1
- 0
app/src/main/java/com/xhly/manageapp/ui/login/activity/LoginActivity.kt Bestand weergeven

@@ -153,6 +153,7 @@ class LoginActivity : BaseActivity<LoginViewModel, ActivityLoginBinding>() {
153 153
         data.doEvent = EventLog.ACCOUNTLOGINEVENT
154 154
         viewModel.eventLog(data)
155 155
         Const.USERID=userBean.userid.toString()
156
+        Const.USERNAME=userBean.username.toString()
156 157
         spUtils.saveJson(Const.USERINFO,userBean)
157 158
         val parseClassToJson = GsonUtils.parseClassToJson(userBean)
158 159
         ZSpProvider.save(this,Const.USERINFO,parseClassToJson)

+ 2
- 0
app/src/main/java/com/xhly/manageapp/ui/main/activity/MainActivity.kt Bestand weergeven

@@ -351,6 +351,7 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>() {
351 351
         super.onResume()
352 352
         userBean?.let {
353 353
             Const.USERID=it.userid.toString()
354
+            Const.USERNAME=it.username.toString()
354 355
             viewModel.postDevicesetDetail(it.schoolid)
355 356
         }
356 357
         viewModel.postWallpaperPad()
@@ -805,6 +806,7 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>() {
805 806
         data.doEvent = EventLog.ACCOUNTQUITEVENT
806 807
         viewModel.eventLog(data)
807 808
         Const.USERID="1"
809
+        Const.USERNAME=""
808 810
         WorkManager.getInstance(this).cancelAllWork()
809 811
         deleteSharedPreferences(SharedPreferencesUtils.SP_FILE_NAME)
810 812
         startIntentActivity(LoginActivity().javaClass)

+ 3
- 0
corelib/src/main/java/com/xhly/corelib/Const.kt Bestand weergeven

@@ -5,6 +5,9 @@ object Const {
5 5
     const val isDebug = true
6 6
     //用户id
7 7
      var USERID = "1"
8
+    //用户姓名
9
+    var USERNAME = ""
10
+
8 11
     //接口地址
9 12
     const val URL1: String = "https://mcapitest.xhkjedu.com/"
10 13
 

Laden…
Annuleren
Opslaan