mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-05-29 11:39:17 +08:00
11 lines
342 B
JavaScript
11 lines
342 B
JavaScript
import { isObject } from './helpers';
|
|
|
|
export default async (ctx, next) => {
|
|
const dataField = ctx.config.dataField ?? ctx.dataField;
|
|
if (ctx.response && isObject(ctx.response.data) && dataField) {
|
|
ctx.response._rawData = ctx.response.data;
|
|
ctx.response.data = ctx.response.data[dataField];
|
|
}
|
|
await next();
|
|
};
|