Update utils.js
This commit is contained in:
parent
a4dca23ce2
commit
7e8075975a
|
@ -184,11 +184,12 @@ utils.writeToFile = function (filename, data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.fetchData = function (item, config) {
|
utils.fetchData = function (item, config) {
|
||||||
const options = config.request
|
const request = { ...config.request }
|
||||||
options.url = typeof config.url === 'function' ? config.url(item) : config.url
|
request.url = typeof config.url === 'function' ? config.url(item) : config.url
|
||||||
options.data = typeof options.data === 'function' ? options.data(item) : options.data
|
request.data =
|
||||||
|
typeof config.request.data === 'function' ? config.request.data(item) : config.request.data
|
||||||
|
|
||||||
return axios(options)
|
return axios(request)
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.getUTCDate = function () {
|
utils.getUTCDate = function () {
|
||||||
|
|
Loading…
Reference in New Issue