package com.ys.bdtp.adm.app

import android.net.ConnectivityManager
import android.net.NetworkCapabilities

/**
 * 判断是否联网
 */
fun isNet(cm: ConnectivityManager): Boolean {
    val network = cm.activeNetwork
    val networkCapabilities = cm.getNetworkCapabilities(network)
    return networkCapabilities?.hasCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED) ?: false
}