```
refactor(env): 调整环境配置和切换逻辑 - 将本地环境配置从注释状态启用,并更新对应的IP地址和端口 - 修改环境切换对话框中的文本标签,重新排列环境选项顺序 - 更新全局数据类中的环境URL常量定义,调整测试和UAT环境地址 - 移除未使用的SPUtil导入,改用SpTool工具类 - 修改应用启动时的默认环境判断逻辑,将特定设备指向本地环境 - 调整环境切换对话框中的RadioButton选中状态和URL映射关系 ```
This commit is contained in:
@@ -22,9 +22,10 @@ object GlobalData {
|
|||||||
/**
|
/**
|
||||||
* 具体业务 BaseUrl
|
* 具体业务 BaseUrl
|
||||||
*/
|
*/
|
||||||
// const val TEST_BASE_URL = "http://192.168.1.201:14801"
|
// const val LOCAL_BASE_URL = "http://192.168.1.201:14801"
|
||||||
const val TEST_BASE_URL = "http://192.168.10.101:24801"
|
const val LOCAL_BASE_URL = "http://192.168.10.101:24801"
|
||||||
const val UAT_BASE_URL = "https://dev.yixiong-tech.com:8083"
|
// const val TEST_BASE_URL = "https://dev.yixiong-tech.com:8083"
|
||||||
|
const val TEST_BASE_URL = "https://dev.yixiong-tech.com:8081"
|
||||||
const val PROD_BASE_URL = "https://api.dm.yixiong-tech.com:8443"
|
const val PROD_BASE_URL = "https://api.dm.yixiong-tech.com:8443"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import com.sw.dualscreen.objbox.ObjectBox
|
|||||||
import com.sw.dualscreen.sdk.SensorScaleUtils
|
import com.sw.dualscreen.sdk.SensorScaleUtils
|
||||||
import com.sw.dualscreen.utils.ActivityManager
|
import com.sw.dualscreen.utils.ActivityManager
|
||||||
import com.sw.dualscreen.utils.CrashHandler
|
import com.sw.dualscreen.utils.CrashHandler
|
||||||
import com.sw.dualscreen.utils.SPUtil
|
|
||||||
import com.sw.dualscreen.utils.SpTool
|
import com.sw.dualscreen.utils.SpTool
|
||||||
import com.sw.plate.App
|
import com.sw.plate.App
|
||||||
import com.sw.plate.utils.AppUtil
|
import com.sw.plate.utils.AppUtil
|
||||||
@@ -40,7 +39,7 @@ class MyApp : App() {
|
|||||||
} else {
|
} else {
|
||||||
// 未保存过则使用默认逻辑:特定设备走测试环境,其余走 UAT
|
// 未保存过则使用默认逻辑:特定设备走测试环境,其余走 UAT
|
||||||
GlobalData.appBaseUrl =
|
GlobalData.appBaseUrl =
|
||||||
if ("2987f0c5-5754-33e9-b00a-251db5e2e55f" == deviceId) GlobalData.TEST_BASE_URL else GlobalData.PROD_BASE_URL
|
if ("2987f0c5-5754-33e9-b00a-251db5e2e55f" == deviceId) GlobalData.LOCAL_BASE_URL else GlobalData.PROD_BASE_URL
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,8 +39,8 @@ class EnvSwitchDialog(
|
|||||||
override fun initView() {
|
override fun initView() {
|
||||||
// 根据当前 appBaseUrl 预选对应 RadioButton,不匹配则不选
|
// 根据当前 appBaseUrl 预选对应 RadioButton,不匹配则不选
|
||||||
when (GlobalData.appBaseUrl) {
|
when (GlobalData.appBaseUrl) {
|
||||||
GlobalData.TEST_BASE_URL -> binding.rbTest.isChecked = true
|
GlobalData.LOCAL_BASE_URL -> binding.rbTest.isChecked = true
|
||||||
GlobalData.UAT_BASE_URL -> binding.rbUat.isChecked = true
|
GlobalData.TEST_BASE_URL -> binding.rbUat.isChecked = true
|
||||||
GlobalData.PROD_BASE_URL -> binding.rbProd.isChecked = true
|
GlobalData.PROD_BASE_URL -> binding.rbProd.isChecked = true
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,8 +55,8 @@ class EnvSwitchDialog(
|
|||||||
return@setOnClickListener
|
return@setOnClickListener
|
||||||
}
|
}
|
||||||
val newUrl = when (binding.rgEnv.checkedRadioButtonId) {
|
val newUrl = when (binding.rgEnv.checkedRadioButtonId) {
|
||||||
binding.rbTest.id -> GlobalData.TEST_BASE_URL
|
binding.rbTest.id -> GlobalData.LOCAL_BASE_URL
|
||||||
binding.rbUat.id -> GlobalData.UAT_BASE_URL
|
binding.rbUat.id -> GlobalData.TEST_BASE_URL
|
||||||
binding.rbProd.id -> GlobalData.PROD_BASE_URL
|
binding.rbProd.id -> GlobalData.PROD_BASE_URL
|
||||||
else -> return@setOnClickListener
|
else -> return@setOnClickListener
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
android:layout_height="72dp"
|
android:layout_height="72dp"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:paddingStart="16dp"
|
android:paddingStart="16dp"
|
||||||
android:text="测试环境"
|
android:text="本地环境"
|
||||||
android:textColor="#ff141428"
|
android:textColor="#ff141428"
|
||||||
android:textSize="28sp" />
|
android:textSize="28sp" />
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
android:layout_height="72dp"
|
android:layout_height="72dp"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:paddingStart="16dp"
|
android:paddingStart="16dp"
|
||||||
android:text="UAT 环境"
|
android:text="测试环境"
|
||||||
android:textColor="#ff141428"
|
android:textColor="#ff141428"
|
||||||
android:textSize="28sp" />
|
android:textSize="28sp" />
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user