honghengqiang 1 年之前
父節點
當前提交
6c2e813528

+ 2 - 2
app/build.gradle

@@ -15,8 +15,8 @@ android {
         applicationId "com.swagolite.app"
         minSdkVersion 21
         targetSdkVersion 31
-        versionCode 1002
-        versionName "1.0.0.2"
+        versionCode 1003
+        versionName "1.0.0.3"
         multiDexEnabled true
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
 

+ 12 - 16
app/src/main/java/com/swago/app/SplashVm.kt

@@ -51,10 +51,16 @@ class SplashVm(application: Application) : BaseViewModel(application) {
     fun getApiDomain() {
         requestData2(false) {
             requestData {
-                val data = ApiManager.configApi.getApiDomain()
-                setBaseUrl(data.host)
+                val domainUrl = ApiManager.configApi.getApiDomain()
+                setBaseUrl(domainUrl.host)
                 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) {
                     jumpToLoginLiveData.value = false
                 } else {
@@ -107,8 +113,8 @@ class SplashVm(application: Application) : BaseViewModel(application) {
     private fun setBaseUrl(baseUrl: String) {
         if (BuildConfig.DEBUG) {
 //            UrlConstant.BASE_URL =   "http:test-api.swago.cn"
-//            UrlConstant.BASE_URL =   "http:huawei.swago.cn"
-            UrlConstant.BASE_URL =   "https://pro-api.swago.cn"
+            UrlConstant.BASE_URL =   "http:huawei.swago.cn"
+//            UrlConstant.BASE_URL =   "https://pro-api.swago.cn"
         } else {
             UrlConstant.BASE_URL = baseUrl
         }
@@ -116,12 +122,6 @@ class SplashVm(application: Application) : BaseViewModel(application) {
 
     fun loginByAuto() {
         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()
             UserInfo.setLoginInfo(data)
             SpUtil.putString("login_info", Gson().toJson(data))
@@ -137,11 +137,7 @@ class SplashVm(application: Application) : BaseViewModel(application) {
      */
     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
+
         }
     }
 }

+ 2 - 1
baseswago/src/main/java/com/swago/baseswago/baseroom/ui/AbsUserActivity.kt

@@ -50,6 +50,8 @@ abstract class AbsUserActivity<T: ActivityAbsRoomUserBinding,E: IRoomInfo> : Bas
 
         SwagoRoomManager.roleType = roleType
         SwagoRoomManager.addListener(this)
+        initUserRoomView()
+
         binding.rv.layoutManager = pagerLayoutManager
         binding.rv.animation = null
         binding.rv.adapter = adapter
@@ -57,7 +59,6 @@ abstract class AbsUserActivity<T: ActivityAbsRoomUserBinding,E: IRoomInfo> : Bas
         binding.rv.scrollToPosition(mCurrentPosition)
         pagerLayoutManager.scrollToPositionWithOffset(mCurrentPosition,0)
 
-        initUserRoomView()
         initLiveData()
     }
 

+ 2 - 2
baseswago/src/main/java/com/swago/baseswago/constant/UrlConstant.kt

@@ -15,8 +15,8 @@ object UrlConstant {
 
     var BASE_URL = if (BuildConfig.DEBUG) {
 //            "http:test-api.swago.cn"
-//            "http:huawei.swago.cn"
-        "https://pro-api.swago.cn"
+            "http:huawei.swago.cn"
+//        "https://pro-api.swago.cn"
     } else {
             "https://pro-api.swago.cn"
         }