mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-06 03:59:53 +08:00
fix: request response 问题
This commit is contained in:
parent
31f5a3409e
commit
4786541c56
@ -2,7 +2,7 @@ import { isFunction, isObject, isString } from './helpers';
|
|||||||
|
|
||||||
export default async ({ response, responseDataAdaptor }, next) => {
|
export default async ({ response, responseDataAdaptor }, next) => {
|
||||||
// 如果 data 是 blob 并且 content-type 是 application/json,自动进行数据处理
|
// 如果 data 是 blob 并且 content-type 是 application/json,自动进行数据处理
|
||||||
if (response.data instanceof Blob && response.headers['content-type'].startsWith('application/json') && response.data.type === 'application/json') {
|
if (response && response.data instanceof Blob && response.headers['content-type'].startsWith('application/json') && response.data.type === 'application/json') {
|
||||||
const rawData = response.data;
|
const rawData = response.data;
|
||||||
try {
|
try {
|
||||||
response.data = JSON.parse(await response.data.text());
|
response.data = JSON.parse(await response.data.text());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user