From 09bfd93edc47c7e946005458e22e07252fd08b06 Mon Sep 17 00:00:00 2001 From: Xicheng Guo Date: Tue, 12 Nov 2024 10:02:40 +0800 Subject: [PATCH] update --- .../java/com/android/skip/util/NetworkUtils.kt | 16 ++++++++++++++++ docs/inspect/InspectHeader.vue | 3 ++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 app/src/main/java/com/android/skip/util/NetworkUtils.kt diff --git a/app/src/main/java/com/android/skip/util/NetworkUtils.kt b/app/src/main/java/com/android/skip/util/NetworkUtils.kt new file mode 100644 index 00000000..a11566ae --- /dev/null +++ b/app/src/main/java/com/android/skip/util/NetworkUtils.kt @@ -0,0 +1,16 @@ +package com.android.skip.util + +import android.content.Context +import android.net.ConnectivityManager +import android.net.NetworkCapabilities +import android.os.Build + + +object NetworkUtil { + fun isNetworkConnected(context: Context): Boolean { + val cm = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager + val network = cm.activeNetwork ?: return false + val capabilities = cm.getNetworkCapabilities(network) ?: return false + return capabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET) + } +} \ No newline at end of file diff --git a/docs/inspect/InspectHeader.vue b/docs/inspect/InspectHeader.vue index d248407a..17a29b15 100644 --- a/docs/inspect/InspectHeader.vue +++ b/docs/inspect/InspectHeader.vue @@ -3,7 +3,8 @@ 批量上传 - 批量删除 + + 批量删除 获取示例