Bläddra i källkod

修改开发环境与测试环境的配置

tianka 1 vecka sedan
förälder
incheckning
a5067905df

+ 19 - 1
commonlibrary/build.gradle

@@ -5,6 +5,24 @@ import com.yc.buildsrc.*
 android {
     resourcePrefix "common_"
 
+    buildTypes {
+        debug {
+            buildConfigField "String", "ENV", "\"test\""
+            buildConfigField "String", "URL_BASE", "\"http://test.api.tianka.chat/\""
+            buildConfigField "String", "WSS_BASE", "\"wss://test.link.tianka.chat/access\""
+            buildConfigField "String", "H5_BASE_URL", "\"https://test.h5.tianka.chat/\""
+            buildConfigField "String", "ZEGO_APP_ID", "\"864542469\""
+            buildConfigField "String", "ZEGO_APP_SIGN", "\"b9bcdbde3ad4af448f9af7e990a4457b1ae186d7ad52a74f3f321213768b15eb\""
+        }
+        release {
+            buildConfigField "String", "ENV", "\"prod\""
+            buildConfigField "String", "URL_BASE", "\"https://api.whzytkj.online/\""
+            buildConfigField "String", "WSS_BASE", "\"wss://link.whzytkj.online/access\""
+            buildConfigField "String", "H5_BASE_URL", "\"https://h5.whzytkj.online/\""
+            buildConfigField "String", "ZEGO_APP_ID", "\"1223504772\""
+            buildConfigField "String", "ZEGO_APP_SIGN", "\"ed4c608d30b05c1390d0e862fdd05c8e670a596b1cd66434a7c7f2df1783742c\""
+        }
+    }
 }
 
 dependencies {
@@ -16,4 +34,4 @@ dependencies {
     api project(path: ':libBytedance')
     kapt DependencyConfig.GitHub.AutoServiceAnnotations
     kapt DependencyConfig.JetPack.LifecycleCompilerAPT
-}
+}

+ 33 - 29
commonlibrary/src/main/java/com/yc/commonlibrary/Constans.kt

@@ -7,37 +7,41 @@ const val URL_BASE = "https://api.whzytkj.online/"
 const val WSS_BASE = "wss://link.whzytkj.online/access"
  **/
 
-const val URL_BASE = "https://api.whzytkj.online/"
-const val WSS_BASE = "wss://link.whzytkj.online/access"
-
-// const val URL_BASE = "http://test.api.tianka.chat/"
-// const val WSS_BASE = "wss://test.link.tianka.chat/access"
-
-//const val URL_BASE = "https://api.manbowangluo.fun/"
-//const val URL_BASE = "https://dev-api.syjinshanshan.com"
-
-
-const val H5_BASE_URL = "https://h5.whzytkj.online/"
-// const val H5_BASE_URL = "https://test.h5.tianka.chat/"
-
-
-const val AGREE = H5_BASE_URL + "agree"//用户协议
-const val CONCEAL = H5_BASE_URL + "conceal"//用户隐私协议
-const val ANCHOR = H5_BASE_URL + "anchor"//主播协议
-const val RECHARGE = H5_BASE_URL + "recharge"//用户充值协议
-const val SERVICE = H5_BASE_URL + "contactService"//客服
-const val HELP = H5_BASE_URL + "help"//帮助
-const val EXCHANGE = H5_BASE_URL + "newExchangeCoin"//兑换
-const val CERTIFIED = H5_BASE_URL + "certificationMain"//实名
-const val LEVEL = H5_BASE_URL + "equityLevel"//等级
-const val GIFT_WALL = H5_BASE_URL + "giftWall"//礼物墙活动规则
+@JvmField
+val env: String = BuildConfig.ENV
+
+@JvmField
+val URL_BASE: String = BuildConfig.URL_BASE
+
+@JvmField
+val WSS_BASE: String = BuildConfig.WSS_BASE
+
+@JvmField
+val H5_BASE_URL: String = BuildConfig.H5_BASE_URL
+
+@JvmField
+val zego_app_id: String = BuildConfig.ZEGO_APP_ID
+
+@JvmField
+val zego_appSign: String = BuildConfig.ZEGO_APP_SIGN
+
+val AGREE: String = H5_BASE_URL + "agree"//用户协议
+val CONCEAL: String = H5_BASE_URL + "conceal"//用户隐私协议
+val ANCHOR: String = H5_BASE_URL + "anchor"//主播协议
+val RECHARGE: String = H5_BASE_URL + "recharge"//用户充值协议
+val SERVICE: String = H5_BASE_URL + "contactService"//客服
+val HELP: String = H5_BASE_URL + "help"//帮助
+val EXCHANGE: String = H5_BASE_URL + "newExchangeCoin"//兑换
+val CERTIFIED: String = H5_BASE_URL + "certificationMain"//实名
+val LEVEL: String = H5_BASE_URL + "equityLevel"//等级
+val GIFT_WALL: String = H5_BASE_URL + "giftWall"//礼物墙活动规则
 const val DEF_HEAD = "https://resources.syjinshanshan.com/UserResources/Default/icon_app_def.png"//礼物墙活动规则
 
-const val GUIZU = H5_BASE_URL + "nobility?"//guizu
-const val ANQUAN = H5_BASE_URL + "interactionRules"//
-const val FAMILY = H5_BASE_URL + "familyManagement"//
-const val ANCHOR_CENTER = H5_BASE_URL + "anchorCenter"//
-const val APPLY_ANCHOR_FAMILY = H5_BASE_URL + "myUnion"//
+val GUIZU: String = H5_BASE_URL + "nobility?"//guizu
+val ANQUAN: String = H5_BASE_URL + "interactionRules"//
+val FAMILY: String = H5_BASE_URL + "familyManagement"//
+val ANCHOR_CENTER: String = H5_BASE_URL + "anchorCenter"//
+val APPLY_ANCHOR_FAMILY: String = H5_BASE_URL + "myUnion"//
 
 
 const val WECHAT_APPID = "wx6b967b3a9c0f56eb"//微信appid

+ 5 - 2
module_live/src/main/java/com/yc/module_live/stats/KeyCenter.java

@@ -1,18 +1,21 @@
 package com.yc.module_live.stats;
 
+import com.yc.commonlibrary.ConstansKt;
+
 public final class KeyCenter {
 
     // Developers can get appID from admin console.
     // https://console.zego.im/dashboard
     // for example: 123456789L;
-    private long _appID = 1223504772;
+//    private long _appID = 1223504772;
+    private long _appID = Long.parseLong(ConstansKt.zego_app_id);
 
     // AppSign only meets simple authentication requirements.
     // If you need to upgrade to a more secure authentication method,
     // please refer to [Guide for upgrading the authentication mode from using the AppSign to Token](https://docs.zegocloud.com/faq/token_upgrade)
     // Developers can get AppSign from admin [console](https://console.zego.im/dashboard)
     // for example: "abcdefghijklmnopqrstuvwxyz0123456789abcdegfhijklmnopqrstuvwxyz01";
-    private String _appSign = "ed4c608d30b05c1390d0e862fdd05c8e670a596b1cd66434a7c7f2df1783742c";
+    private String _appSign =  ConstansKt.zego_appSign;
 
     private static KeyCenter instance = new KeyCenter();
     private KeyCenter() {}