fix: 申请证书没有使用到系统设置的http代理的bug

This commit is contained in:
xiaojunnuo
2024-10-22 01:01:04 +08:00
parent 4a7018ac26
commit 3db216f515
10 changed files with 151 additions and 25 deletions

View File

@@ -35,6 +35,14 @@ export class HttpError extends Error {
params: error.config?.params,
data: error.config?.data,
};
let url = error.config?.url;
if (error.config?.baseURL) {
url = error.config?.baseURL + url;
}
if (url) {
this.message = `${this.message} : ${url}`;
}
this.response = {
data: error.response?.data,
};
@@ -62,6 +70,10 @@ export function setGlobalProxy(opts: { httpProxy?: string; httpsProxy?: string }
defaultAgents = createAgent();
}
export function getGlobalAgents() {
return defaultAgents;
}
/**
* @description 创建请求实例
*/