perf: http请求增加默认超时时间

pull/189/head
xiaojunnuo 2024-09-10 11:58:58 +08:00
parent e0241686dc
commit 664bd863e5
1 changed files with 3 additions and 0 deletions

View File

@ -46,6 +46,9 @@ export function createAxiosService({ logger }: { logger: Logger }) {
service.interceptors.request.use(
(config: any) => {
logger.info(`http request:${config.url}method:${config.method}params:${JSON.stringify(config.params)}`);
if (config.timeout == null) {
config.timeout = 10000;
}
return config;
},
(error: Error) => {