mirror of
https://github.com/certd/certd.git
synced 2026-04-28 07:57:25 +08:00
perf: http请求增加默认超时时间
This commit is contained in:
@@ -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) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user