mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-20 02:08:15 +08:00
错误格式标准化
This commit is contained in:
parent
373c9af867
commit
08c88e9e27
@ -97,7 +97,7 @@ public class CustomerGlobalFilter implements GlobalFilter, Ordered {
|
|||||||
} else if (MediaType.APPLICATION_FORM_URLENCODED.equals(mediaType)) {
|
} else if (MediaType.APPLICATION_FORM_URLENCODED.equals(mediaType)) {
|
||||||
return handlePostRequestFormUrlencoded(exchange, route, request, accessKeyName, headerAk, body);
|
return handlePostRequestFormUrlencoded(exchange, route, request, accessKeyName, headerAk, body);
|
||||||
}
|
}
|
||||||
throw new ContentTypeNotSupportedException();
|
return Mono.error(ContentTypeNotSupportedException::new);
|
||||||
});
|
});
|
||||||
return GatewayUtils.modifyBody(exchange, chain, modifiedBody);
|
return GatewayUtils.modifyBody(exchange, chain, modifiedBody);
|
||||||
}
|
}
|
||||||
@ -312,7 +312,7 @@ public class CustomerGlobalFilter implements GlobalFilter, Ordered {
|
|||||||
}
|
}
|
||||||
setResponseStatus(exchange, HttpStatus.TOO_MANY_REQUESTS);
|
setResponseStatus(exchange, HttpStatus.TOO_MANY_REQUESTS);
|
||||||
exchange.getResponse().setComplete();
|
exchange.getResponse().setComplete();
|
||||||
throw new RateLimitException(limit.intValue(), 1, timeUnit);
|
return Mono.error(new RateLimitException(limit.intValue(), 1, timeUnit));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user