mirror of
https://github.com/smallfawn/QLScriptPublic.git
synced 2025-12-17 23:35:02 +08:00
Update jlqc.js
This commit is contained in:
19
jlqc.js
19
jlqc.js
@@ -401,18 +401,13 @@ function randomszdx(e) {
|
|||||||
}
|
}
|
||||||
function changeCode(oldoptions) {
|
function changeCode(oldoptions) {
|
||||||
let newoptions = new Object()
|
let newoptions = new Object()
|
||||||
newoptions.url = changeUrl(oldoptions)
|
'qs' in oldoptions ? newoptions.url = changeUrl('qs') : ('params' in oldoptions ? newoptions.url = changeUrl('params') : newoptions.url = oldoptions.url)
|
||||||
'content-type' in oldoptions.headers ? newoptions.headers = changeHeaders(oldoptions.headers) : newoptions.headers = oldoptions.headers
|
'content-type' in oldoptions.headers ? newoptions.headers = changeHeaders(oldoptions.headers) : newoptions.headers = oldoptions.headers
|
||||||
function changeUrl(options) {
|
function changeUrl(type) {
|
||||||
let urlParameter
|
url = oldoptions.url + '?'
|
||||||
'qs' in options ? urlParameter = changeUrlParameter('qs') : ('params' in options ? urlParameter = changeUrlParameter('params') : urlParameter = options.url)
|
for (let key in oldoptions[type]) { url += key + '=' + oldoptions[type][key] + '&' }
|
||||||
function changeUrlParameter(type) {
|
url = url.substring(0, url.length - 1)
|
||||||
url = options.url + '?'
|
return url
|
||||||
for (let key in options[type]) { url += key + '=' + options[type][key] + '&' }
|
|
||||||
url = url.substring(0, url.length - 1)
|
|
||||||
return url
|
|
||||||
}
|
|
||||||
return urlParameter
|
|
||||||
}
|
}
|
||||||
function changeHeaders(headers) {
|
function changeHeaders(headers) {
|
||||||
let tmp = headers['content-type']
|
let tmp = headers['content-type']
|
||||||
@@ -437,7 +432,7 @@ function httpRequest(options, method) {
|
|||||||
//console.log(JSON.parse(err));
|
//console.log(JSON.parse(err));
|
||||||
$.logErr(err);
|
$.logErr(err);
|
||||||
//throw new Error(err);
|
//throw new Error(err);
|
||||||
console.log(err);
|
//console.log(err);
|
||||||
} else {
|
} else {
|
||||||
//httpResult = data;
|
//httpResult = data;
|
||||||
//httpResponse = resp;
|
//httpResponse = resp;
|
||||||
|
|||||||
Reference in New Issue
Block a user