Update utils.js
This commit is contained in:
parent
58a8982c37
commit
8552e6fb14
|
@ -70,7 +70,8 @@ utils.createClient = function (config) {
|
||||||
client.interceptors.response.use(
|
client.interceptors.response.use(
|
||||||
function (response) {
|
function (response) {
|
||||||
if (config.debug) {
|
if (config.debug) {
|
||||||
const data = utils.isObject(response.data)
|
const data =
|
||||||
|
utils.isObject(response.data) || Array.isArray(response.data)
|
||||||
? JSON.stringify(response.data)
|
? JSON.stringify(response.data)
|
||||||
: response.data.toString()
|
: response.data.toString()
|
||||||
console.log(
|
console.log(
|
||||||
|
@ -315,7 +316,8 @@ utils.getUTCDate = function (d = null) {
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.parseResponse = async (item, response, config) => {
|
utils.parseResponse = async (item, response, config) => {
|
||||||
const content = utils.isObject(response.data)
|
const content =
|
||||||
|
utils.isObject(response.data) || Array.isArray(response.data)
|
||||||
? JSON.stringify(response.data)
|
? JSON.stringify(response.data)
|
||||||
: response.data.toString()
|
: response.data.toString()
|
||||||
const buffer = Buffer.from(content, 'utf8')
|
const buffer = Buffer.from(content, 'utf8')
|
||||||
|
|
Loading…
Reference in New Issue