|
@@ -3,7 +3,9 @@ package com.xhly.manageapp.viewmodel
|
3
|
3
|
import android.app.usage.UsageEvents.Event
|
4
|
4
|
import androidx.lifecycle.LiveData
|
5
|
5
|
import androidx.lifecycle.MutableLiveData
|
|
6
|
+import com.xhly.corelib.Const
|
6
|
7
|
import com.xhly.corelib.base.viewmodel.CommonBaseViewModel
|
|
8
|
+import com.xhly.corelib.eventbus.UIEvent
|
7
|
9
|
import com.xhly.corelib.network.RetrofitService
|
8
|
10
|
import com.xhly.corelib.utils.LogShow
|
9
|
11
|
import com.xhly.corelib.utils.MD5Utils
|
|
@@ -176,7 +178,7 @@ open class BaseViewModel : CommonBaseViewModel() {
|
176
|
178
|
/**
|
177
|
179
|
* 同步服务器的时间
|
178
|
180
|
*/
|
179
|
|
- fun postSyncTime() {
|
|
181
|
+ fun postSyncTime(resetAppSocket:Boolean=false) {
|
180
|
182
|
launchUI {
|
181
|
183
|
val startTime = System.currentTimeMillis()
|
182
|
184
|
val postSyncTime = loginService.postSyncTime()
|
|
@@ -188,6 +190,9 @@ open class BaseViewModel : CommonBaseViewModel() {
|
188
|
190
|
LogShow("设置的时间是"+SystemClock.getDateString(l))
|
189
|
191
|
/*timeResult.value = l*/
|
190
|
192
|
timeResult.value = obj
|
|
193
|
+ if (resetAppSocket){
|
|
194
|
+ UIEvent(Const.STARTSOCKET).post()
|
|
195
|
+ }
|
191
|
196
|
} else {
|
192
|
197
|
if (!postSyncTime.msg.isNullOrEmpty()) {
|
193
|
198
|
netMessage.value = postSyncTime.msg
|