|
|
@ -142,18 +142,14 @@ class AnalyzeUrl( |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private fun initUrl() { //replaceKeyPageJs已经替换掉额外内容,此处url是基础形式,可以直接切首个‘,’之前字符串。 |
|
|
|
private fun initUrl() { //replaceKeyPageJs已经替换掉额外内容,此处url是基础形式,可以直接切首个‘,’之前字符串。 |
|
|
|
|
|
|
|
|
|
|
|
var pos = ruleUrl.indexOf(',') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
urlHasQuery = ruleUrl.substringBefore(',') |
|
|
|
urlHasQuery = ruleUrl.substringBefore(',') |
|
|
|
|
|
|
|
|
|
|
|
url = NetworkUtils.getAbsoluteURL(baseUrl,urlHasQuery ) |
|
|
|
url = NetworkUtils.getAbsoluteURL(baseUrl,urlHasQuery ) |
|
|
|
|
|
|
|
|
|
|
|
NetworkUtils.getBaseUrl(url)?.let { |
|
|
|
NetworkUtils.getBaseUrl(url)?.let { |
|
|
|
baseUrl = it |
|
|
|
baseUrl = it |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(pos != -1 ) { |
|
|
|
if(urlHasQuery.length != ruleUrl.length ) { |
|
|
|
GSON.fromJsonObject<UrlOption>(ruleUrl.substring(pos + 1).trim{ it < '!'})?.let { option -> |
|
|
|
GSON.fromJsonObject<UrlOption>(ruleUrl.substring(urlHasQuery.length + 1).trim{ it < '!'})?.let { option -> |
|
|
|
|
|
|
|
|
|
|
|
option.method?.let { |
|
|
|
option.method?.let { |
|
|
|
if (it.equals("POST", true)) method = RequestMethod.POST |
|
|
|
if (it.equals("POST", true)) method = RequestMethod.POST |
|
|
@ -191,7 +187,7 @@ class AnalyzeUrl( |
|
|
|
when (method) { |
|
|
|
when (method) { |
|
|
|
RequestMethod.GET -> { |
|
|
|
RequestMethod.GET -> { |
|
|
|
if (!useWebView) { |
|
|
|
if (!useWebView) { |
|
|
|
pos = url.indexOf('?') |
|
|
|
val pos = url.indexOf('?') |
|
|
|
if(pos != -1) { |
|
|
|
if(pos != -1) { |
|
|
|
analyzeFields(url.substring(pos + 1)) |
|
|
|
analyzeFields(url.substring(pos + 1)) |
|
|
|
url = url.substring(0,pos) |
|
|
|
url = url.substring(0,pos) |
|
|
|