mirror of https://github.com/certd/certd
perf: http请求增加默认超时时间
parent
e0241686dc
commit
664bd863e5
|
@ -46,6 +46,9 @@ export function createAxiosService({ logger }: { logger: Logger }) {
|
||||||
service.interceptors.request.use(
|
service.interceptors.request.use(
|
||||||
(config: any) => {
|
(config: any) => {
|
||||||
logger.info(`http request:${config.url},method:${config.method},params:${JSON.stringify(config.params)}`);
|
logger.info(`http request:${config.url},method:${config.method},params:${JSON.stringify(config.params)}`);
|
||||||
|
if (config.timeout == null) {
|
||||||
|
config.timeout = 10000;
|
||||||
|
}
|
||||||
return config;
|
return config;
|
||||||
},
|
},
|
||||||
(error: Error) => {
|
(error: Error) => {
|
||||||
|
|
Loading…
Reference in New Issue