Browse Source

1.添加UserName常量。

20241218TB223FC(测试jar包)
wangwanlei 9 months ago
parent
commit
413d9c6f43

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

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

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

153
         data.doEvent = EventLog.ACCOUNTLOGINEVENT
153
         data.doEvent = EventLog.ACCOUNTLOGINEVENT
154
         viewModel.eventLog(data)
154
         viewModel.eventLog(data)
155
         Const.USERID=userBean.userid.toString()
155
         Const.USERID=userBean.userid.toString()
156
+        Const.USERNAME=userBean.username.toString()
156
         spUtils.saveJson(Const.USERINFO,userBean)
157
         spUtils.saveJson(Const.USERINFO,userBean)
157
         val parseClassToJson = GsonUtils.parseClassToJson(userBean)
158
         val parseClassToJson = GsonUtils.parseClassToJson(userBean)
158
         ZSpProvider.save(this,Const.USERINFO,parseClassToJson)
159
         ZSpProvider.save(this,Const.USERINFO,parseClassToJson)

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

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

+ 3
- 0
corelib/src/main/java/com/xhly/corelib/Const.kt View File

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

Loading…
Cancel
Save