mirror of
https://github.com/smallfawn/QLScriptPublic.git
synced 2025-12-17 15:25:10 +08:00
Update jlqc.js
This commit is contained in:
8
jlqc.js
8
jlqc.js
@@ -402,7 +402,7 @@ function randomszdx(e) {
|
|||||||
function changeCode(oldoptions) {
|
function changeCode(oldoptions) {
|
||||||
let newoptions = new Object()
|
let newoptions = new Object()
|
||||||
newoptions.url = changeUrl(oldoptions)
|
newoptions.url = changeUrl(oldoptions)
|
||||||
newoptions.headers = oldoptions.headers
|
'content-type' in oldoptions.headers ? newoptions.headers = changeHeaders(oldoptions.headers) : newoptions.headers = oldoptions.headers
|
||||||
function changeUrl(options) {
|
function changeUrl(options) {
|
||||||
let urlParameter
|
let urlParameter
|
||||||
'qs' in options ? urlParameter = changeUrlParameter('qs') : ('params' in options ? urlParameter = changeUrlParameter('params') : urlParameter = options.url)
|
'qs' in options ? urlParameter = changeUrlParameter('qs') : ('params' in options ? urlParameter = changeUrlParameter('params') : urlParameter = options.url)
|
||||||
@@ -414,6 +414,12 @@ function changeCode(oldoptions) {
|
|||||||
}
|
}
|
||||||
return urlParameter
|
return urlParameter
|
||||||
}
|
}
|
||||||
|
function changeHeaders(headers) {
|
||||||
|
let tmp = headers['content-type']
|
||||||
|
delete headers['content-type']
|
||||||
|
headers['Content-Type'] = tmp
|
||||||
|
return headers
|
||||||
|
}
|
||||||
'body' in oldoptions ? ((Object.prototype.toString.call(oldoptions.body) === '[object Object]') ? newoptions.body = JSON.stringify(oldoptions.body) : newoptions.body = oldoptions.body) : ''
|
'body' in oldoptions ? ((Object.prototype.toString.call(oldoptions.body) === '[object Object]') ? newoptions.body = JSON.stringify(oldoptions.body) : newoptions.body = oldoptions.body) : ''
|
||||||
'data' in oldoptions ? ((Object.prototype.toString.call(oldoptions.data) === '[object Object]') ? newoptions.body = JSON.stringify(oldoptions.data) : newoptions.body = oldoptions.data) : ''
|
'data' in oldoptions ? ((Object.prototype.toString.call(oldoptions.data) === '[object Object]') ? newoptions.body = JSON.stringify(oldoptions.data) : newoptions.body = oldoptions.data) : ''
|
||||||
'form' in oldoptions ? ((Object.prototype.toString.call(oldoptions.form) === '[object Object]') ? newoptions.body = JSON.stringify(oldoptions.form) : newoptions.body = oldoptions.form) : ''
|
'form' in oldoptions ? ((Object.prototype.toString.call(oldoptions.form) === '[object Object]') ? newoptions.body = JSON.stringify(oldoptions.form) : newoptions.body = oldoptions.form) : ''
|
||||||
|
|||||||
Reference in New Issue
Block a user