mirror of
https://github.com/certd/certd.git
synced 2026-04-15 13:32:37 +08:00
fix: 申请证书没有使用到系统设置的http代理的bug
This commit is contained in:
@@ -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 创建请求实例
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user