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