mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-05-25 17:09:20 +08:00
12 lines
314 B
JavaScript
12 lines
314 B
JavaScript
import { checkHttpRequestHasBody, trimObj } from './helpers';
|
|
|
|
export default async (ctx, next) => {
|
|
const config = ctx.config;
|
|
if (checkHttpRequestHasBody(config.method)) {
|
|
config.data = trimObj(config.data);
|
|
} else {
|
|
config.params = trimObj(config.params);
|
|
}
|
|
await next();
|
|
};
|