关联用户列表优化
This commit is contained in:
@@ -181,7 +181,9 @@ class LinkedUserActivity : AppCompatActivity() {
|
|||||||
binding.swipeRefresh.isRefreshing = true
|
binding.swipeRefresh.isRefreshing = true
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
try {
|
try {
|
||||||
val deviceId = DeviceIdEvent.getDeviceId()
|
var deviceId: String? = null
|
||||||
|
if (mode == MODE_SETTINGS) {
|
||||||
|
deviceId = DeviceIdEvent.getDeviceId()
|
||||||
if (deviceId.isNullOrEmpty()) {
|
if (deviceId.isNullOrEmpty()) {
|
||||||
Toast.makeText(this@LinkedUserActivity, "设备 ID 为空", Toast.LENGTH_SHORT).show()
|
Toast.makeText(this@LinkedUserActivity, "设备 ID 为空", Toast.LENGTH_SHORT).show()
|
||||||
withContext(Dispatchers.Main) {
|
withContext(Dispatchers.Main) {
|
||||||
@@ -189,8 +191,9 @@ class LinkedUserActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
return@launch
|
return@launch
|
||||||
}
|
}
|
||||||
|
}
|
||||||
val response = if (mode == MODE_SETTINGS) {
|
val response = if (mode == MODE_SETTINGS) {
|
||||||
RetrofitNetwork.getNetworkService().getDeviceUserList(deviceId)
|
RetrofitNetwork.getNetworkService().getDeviceUserList(deviceId!!)
|
||||||
} else {
|
} else {
|
||||||
RetrofitNetwork.getNetworkService().getFamilyMembers()
|
RetrofitNetwork.getNetworkService().getFamilyMembers()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user