diff --git a/packages/fes-plugin-request/src/template/resDataAdaptor.js b/packages/fes-plugin-request/src/template/resDataAdaptor.js index a045f62a..91d3a0f8 100644 --- a/packages/fes-plugin-request/src/template/resDataAdaptor.js +++ b/packages/fes-plugin-request/src/template/resDataAdaptor.js @@ -2,7 +2,7 @@ import { isFunction, isObject, isString } from './helpers'; export default async ({ response, responseDataAdaptor }, next) => { // 如果 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; try { response.data = JSON.parse(await response.data.text());