|
|
|
@ -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. |
|
|
|
|