设备联调优化
This commit is contained in:
@@ -51,11 +51,9 @@ class InitActivity : BaseActivity() {
|
||||
binding = ActivityInitBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
|
||||
// 获取 ANDROID_ID
|
||||
val androidId =
|
||||
Settings.Secure.getString(contentResolver, Settings.Secure.ANDROID_ID)
|
||||
App.deviceId = androidId
|
||||
SpTool.put(SpTool.DEVICE_ID, androidId)
|
||||
|
||||
App.deviceId = AppUtil.getUDID( this)
|
||||
SpTool.put(SpTool.DEVICE_ID, App.deviceId)
|
||||
App.configUrl = UrlConfig.BASE_URL
|
||||
App.canteenId = "0"
|
||||
|
||||
@@ -115,7 +113,7 @@ class InitActivity : BaseActivity() {
|
||||
when (state) {
|
||||
is UiState.Loading -> {}
|
||||
is UiState.Success<*> -> {
|
||||
state.data.result?.let { deviceToken ->
|
||||
state.data.data?.let { deviceToken ->
|
||||
Log.d(TAG, "initConfig: $deviceToken")
|
||||
viewModel.getDeviceConfig(
|
||||
deviceId = App.deviceId,
|
||||
@@ -133,7 +131,7 @@ class InitActivity : BaseActivity() {
|
||||
when (state) {
|
||||
is UiState.Loading -> {}
|
||||
is UiState.Success<*> -> {
|
||||
state.data.result?.let {
|
||||
state.data.data?.let {
|
||||
if (it is DeviceConfigInfo) {
|
||||
SpTool.put(SpTool.DEVICE_CONFIG_CACHE, it.toJsonString())
|
||||
App.configUrl = it.appPackageUrl?:""
|
||||
|
||||
Reference in New Issue
Block a user