onRequest method
Called when the request is about to be sent.
Implementation
@override
void onRequest(RequestOptions options, RequestInterceptorHandler handler) {
// 设置公共请求头
publicHeaders.forEach((key, value) {
options.headers[key] = value;
});
// 设置公共请求参数,虽然不推荐,就怕有人不按规范搞
publicQueryParams.forEach((key, value) {
options.queryParameters[key] = value;
});
super.onRequest(options, handler);
}