uu
This commit is contained in:
parent
3dfde68dbc
commit
bd87b4aae5
@ -14,7 +14,8 @@ const coreRequestBase = (url, reqParams, options = {}, methodType = "POST", core
|
||||
url,
|
||||
data: reqParams,
|
||||
header: options,
|
||||
method: methodType,
|
||||
method: methodType,
|
||||
timeout: 10*60*1000, // 请求超时
|
||||
...coreParams,
|
||||
success: (res) => {
|
||||
resolve(res)
|
||||
@ -80,28 +81,28 @@ let coreRequest = function(url, params = {}, options = {}, methodType, coreParam
|
||||
// emoUnicode(res, 2)
|
||||
return res
|
||||
})
|
||||
}
|
||||
|
||||
const coreDownloadRequest = (url, params = {}, options = {}, methodType = 'GET', coreParams = {})=> {
|
||||
let comReqData = getCommonReqData()
|
||||
// 统一把emo转unicode
|
||||
// emoUnicode(params)
|
||||
const reqParams = {
|
||||
...baseParam,
|
||||
...params,
|
||||
}
|
||||
url = `${host}${url}`
|
||||
options = {
|
||||
...comReqData.header,
|
||||
...options,
|
||||
}
|
||||
|
||||
// get请求 需要转成query参
|
||||
url = url + (url.indexOf('?') == -1 ? '?': '') + tansGetParamsToQuery(reqParams)
|
||||
return { url, header: options }
|
||||
}
|
||||
|
||||
const coreDownloadRequest = (url, params = {}, options = {}, methodType = 'GET', coreParams = {})=> {
|
||||
let comReqData = getCommonReqData()
|
||||
// 统一把emo转unicode
|
||||
// emoUnicode(params)
|
||||
const reqParams = {
|
||||
...baseParam,
|
||||
...params,
|
||||
}
|
||||
url = `${host}${url}`
|
||||
options = {
|
||||
...comReqData.header,
|
||||
...options,
|
||||
}
|
||||
|
||||
// get请求 需要转成query参
|
||||
url = url + (url.indexOf('?') == -1 ? '?': '') + tansGetParamsToQuery(reqParams)
|
||||
return { url, header: options }
|
||||
}
|
||||
|
||||
export {
|
||||
export {
|
||||
coreDownloadRequest,
|
||||
coreRequest
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user