|
|
@ -13,18 +13,14 @@ class JsExtensions { |
|
|
|
* js实现跨域访问,不能删 |
|
|
|
* js实现跨域访问,不能删 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
fun ajax(urlStr: String): String? { |
|
|
|
fun ajax(urlStr: String): String? { |
|
|
|
try { |
|
|
|
return try { |
|
|
|
val analyzeUrl = AnalyzeUrl(urlStr, null, null, null, null, null) |
|
|
|
val analyzeUrl = AnalyzeUrl(urlStr, null, null, null, null, null) |
|
|
|
val call = analyzeUrl.getResponse() |
|
|
|
val call = analyzeUrl.getResponse() |
|
|
|
val response = call.execute() |
|
|
|
val response = call.execute() |
|
|
|
if (response.body() != null) { |
|
|
|
response.body()?.toString() |
|
|
|
return response.body()!!.toString() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} catch (e: Exception) { |
|
|
|
} catch (e: Exception) { |
|
|
|
return e.localizedMessage |
|
|
|
e.localizedMessage |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return null |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|