fix(requests): omit JSON based(without encryption) data

This commit is contained in:
greenhat616 2021-05-24 02:00:34 +08:00
parent 97bd7fedf8
commit e0eec75f08
No known key found for this signature in database
GPG Key ID: 8A3F5C6934182137
2 changed files with 5506 additions and 7 deletions

5505
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -172,7 +172,13 @@ const createRequest = (method, url, data, options) => {
}
} catch (e) {
// console.log(e)
answer.body = body
try {
answer.body = JSON.parse(body.toString())
} catch (err) {
// console.log(err)
// can't decrypt and can't parse directly
answer.body = body
}
answer.status = res.status
}