pull/462/head
gedoor 4 years ago
parent 4a916704ad
commit 9c72fdec08
  1. 11
      app/src/main/java/io/legado/app/utils/NetworkUtils.kt

@ -99,12 +99,11 @@ object NetworkUtils {
}
fun getSubDomain(url: String?): String {
var baseUrl = getBaseUrl(url)
if (baseUrl == null) return ""
return if (baseUrl.indexOf(".") == baseUrl.lastIndexOf(".")) {
baseUrl.substring(baseUrl.lastIndexOf("/")+1)
} else baseUrl.substring(baseUrl.indexOf(".")+1)
}
val baseUrl = getBaseUrl(url) ?: return ""
return if (baseUrl.indexOf(".") == baseUrl.lastIndexOf(".")) {
baseUrl.substring(baseUrl.lastIndexOf("/") + 1)
} else baseUrl.substring(baseUrl.indexOf(".") + 1)
}
/**
* Get local Ip address.

Loading…
Cancel
Save