1:添加炼仙传说功能

2:修改混淆,
This commit is contained in:
2026-01-28 18:43:36 +08:00
parent 513cc23d9c
commit 5b27d91278
78 changed files with 3080 additions and 232 deletions

View File

@@ -0,0 +1,65 @@
package com.xscm.moduleutil.base
import androidx.lifecycle.*
import com.xscm.moduleutil.http.RetrofitClient
import com.xscm.moduleutil.widget.room.PassRoomException
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.launch
import okhttp3.MultipartBody
/**
*
*/
open class BaseViewModel : ViewModel(), LifecycleObserver {
private var clickTime: Long = 0
var baseRepository = RetrofitClient.getInstance()
private val passRoom by lazy { MutableLiveData<Exception>() }
private val error by lazy { MutableLiveData<Exception>() }
private val finally by lazy { MutableLiveData<Int>() }
//进入房间
var imgListData: MutableLiveData<List<String>> = MutableLiveData()
var addImgData = MutableLiveData<Any>()
//运行在UI线程的协程
fun launchUI(block: suspend CoroutineScope.() -> Unit) = viewModelScope.launch {
try {
block()
} catch (e: Exception) {
if (e is PassRoomException) {
passRoom.value = e
} else {
error.value = e
// throw e
}
} finally {
finally.value = 200
}
}
/**
* 请求失败,出现异常
*/
fun getError(): LiveData<Exception> {
return error
}
/**
* 请求完成,在此处做一些关闭操作
*/
fun getFinally(): LiveData<Int> {
return finally
}
}