mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-06 03:59:53 +08:00
fix: request plugin data adaptor error
This commit is contained in:
parent
dedd607b3b
commit
3940f238e4
@ -1,7 +1,7 @@
|
|||||||
import { isFunction, isObject, isString } from './helpers';
|
import { isFunction, isObject, isString } from './helpers';
|
||||||
|
|
||||||
export default async ({ response, responseDataAdaptor }, next) => {
|
export default async ({ response, responseDataAdaptor }, next) => {
|
||||||
if (isFunction(responseDataAdaptor) && (isObject(response.data) || isString(response.data))) {
|
if (isFunction(responseDataAdaptor) && response && (isObject(response.data) || isString(response.data))) {
|
||||||
response.data = responseDataAdaptor(response.data);
|
response.data = responseDataAdaptor(response.data);
|
||||||
}
|
}
|
||||||
await next();
|
await next();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user