|
@@ -51,10 +51,16 @@ class SplashVm(application: Application) : BaseViewModel(application) {
|
|
fun getApiDomain() {
|
|
fun getApiDomain() {
|
|
requestData2(false) {
|
|
requestData2(false) {
|
|
requestData {
|
|
requestData {
|
|
- val data = ApiManager.configApi.getApiDomain()
|
|
|
|
- setBaseUrl(data.host)
|
|
|
|
|
|
+ val domainData = ApiManager.configApi.getApiDomain()
|
|
|
|
+ setBaseUrl(domainData.host)
|
|
RetrofitManager.resetUrl()
|
|
RetrofitManager.resetUrl()
|
|
- getAppConfig()
|
|
|
|
|
|
+
|
|
|
|
+ val data = ApiManager.configApi.getAppConfig()
|
|
|
|
+ SpUtil.putString("configModel", gson.toJson(data))
|
|
|
|
+ UrlConstant.setAgoraId(data.agoral_app_id)
|
|
|
|
+ UrlConstant.setImId(data.im_app_id)
|
|
|
|
+ UrlConstant.lottieDownloadUrl = data.special_zip_url
|
|
|
|
+
|
|
if (UserInfo.getLoginModel() == null) {
|
|
if (UserInfo.getLoginModel() == null) {
|
|
jumpToLoginLiveData.value = false
|
|
jumpToLoginLiveData.value = false
|
|
} else {
|
|
} else {
|
|
@@ -116,12 +122,6 @@ class SplashVm(application: Application) : BaseViewModel(application) {
|
|
|
|
|
|
fun loginByAuto() {
|
|
fun loginByAuto() {
|
|
requestData {
|
|
requestData {
|
|
- val configModel = ApiManager.configApi.getAppConfig()
|
|
|
|
- SpUtil.putString("configModel", gson.toJson(configModel))
|
|
|
|
- UrlConstant.setAgoraId(configModel.agoral_app_id)
|
|
|
|
- UrlConstant.setImId(configModel.im_app_id)
|
|
|
|
- UrlConstant.lottieDownloadUrl = configModel.special_zip_url
|
|
|
|
-
|
|
|
|
val data = ApiManager.loginApi.loginByAuto()
|
|
val data = ApiManager.loginApi.loginByAuto()
|
|
UserInfo.setLoginInfo(data)
|
|
UserInfo.setLoginInfo(data)
|
|
SpUtil.putString("login_info", Gson().toJson(data))
|
|
SpUtil.putString("login_info", Gson().toJson(data))
|
|
@@ -131,17 +131,4 @@ class SplashVm(application: Application) : BaseViewModel(application) {
|
|
.navigation()
|
|
.navigation()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
- /**
|
|
|
|
- * 获取配置
|
|
|
|
- */
|
|
|
|
- private fun getAppConfig(){
|
|
|
|
- requestData {
|
|
|
|
- val data = ApiManager.configApi.getAppConfig()
|
|
|
|
- SpUtil.putString("configModel", gson.toJson(data))
|
|
|
|
- UrlConstant.setAgoraId(data.agoral_app_id)
|
|
|
|
- UrlConstant.setImId(data.im_app_id)
|
|
|
|
- UrlConstant.lottieDownloadUrl = data.special_zip_url
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
}
|
|
}
|