|
@@ -21,6 +21,7 @@ import com.xhly.manageapp.bean.log.LogAppStartBean
|
21
|
21
|
import com.xhly.manageapp.bean.log.LogdOperateBean
|
22
|
22
|
import com.xhly.manageapp.network.log.LogService
|
23
|
23
|
import com.xhly.websocket.bean.WebSocketData
|
|
24
|
+import com.xhly.websocket.bean.WebSocketUserBean
|
24
|
25
|
import com.xhly.websocket.service.SocketClient
|
25
|
26
|
import com.xhly.websocket.service.WebSocketHelper
|
26
|
27
|
import com.xhly.websocket.utils.SocketPushUtils
|
|
@@ -68,14 +69,19 @@ class AppSocket : SocketClient() {
|
68
|
69
|
super.onConnectedSuccess()
|
69
|
70
|
UIEvent(Const.UPDATE_CONNECTED_SUCCESS).post()
|
70
|
71
|
val webData = WebSocketData()
|
71
|
|
- webData.code = 1002
|
|
72
|
+ webData.code = 1001
|
72
|
73
|
webData.mid = UUID.randomUUID().toString()
|
73
|
74
|
val currentTimeSeconds = System.currentTimeMillis() / 1000
|
74
|
75
|
webData.timeunix = currentTimeSeconds
|
75
|
|
- webData.fid = 1
|
|
76
|
+ webData.fid = "1"
|
76
|
77
|
val jsMD5 =
|
77
|
78
|
MD5Utils.getJsMD5(webData.code.toString() + "_" + webData.mid + "_" + webData.timeunix.toString())
|
78
|
79
|
webData.sign = MD5Utils.getJsMD5(jsMD5)
|
|
80
|
+ val socketUserBean = WebSocketUserBean()
|
|
81
|
+ socketUserBean.usertype = 1
|
|
82
|
+ socketUserBean.username = "测试"
|
|
83
|
+ socketUserBean.userid = ManageApplication.getDeviceInfo()
|
|
84
|
+ webData.body = socketUserBean
|
79
|
85
|
WebSocketHelper.getInstance().sendSocketString(GsonUtils.parseClassToJson(webData))
|
80
|
86
|
}
|
81
|
87
|
|
|
@@ -92,6 +98,16 @@ class AppSocket : SocketClient() {
|
92
|
98
|
goMainActivity()
|
93
|
99
|
}
|
94
|
100
|
|
|
101
|
+ Const.CODE2003.toString() -> {
|
|
102
|
+ Toast.makeText(context, "解除限制", Toast.LENGTH_LONG).show()
|
|
103
|
+ spUtils.setParam(Const.DISABLEAPP, false)
|
|
104
|
+ goMainActivity()
|
|
105
|
+ }
|
|
106
|
+
|
|
107
|
+ Const.CODE2004.toString() -> {
|
|
108
|
+ //请求接口更新策略
|
|
109
|
+ }
|
|
110
|
+
|
95
|
111
|
Const.CODE2005.toString() -> {
|
96
|
112
|
ManageApplication.rebootDevice()
|
97
|
113
|
}
|