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
+1
View File
@@ -27,6 +27,7 @@
"license": "AGPL",
"dependencies": {
"@certd/basic": "^1.26.10",
"@certd/acme-client": "^1.26.10",
"@certd/pipeline": "^1.26.10",
"@midwayjs/cache": "~3.14.0",
"@midwayjs/core": "~3.17.1",
@@ -7,7 +7,7 @@ import { BaseSettings, SysInstallInfo, SysPrivateSettings, SysPublicSettings, Sy
import * as _ from 'lodash-es';
import { BaseService } from '../../../basic/index.js';
import { logger, setGlobalProxy } from '@certd/basic';
import { agents } from '@certd/acme-client';
/**
* 设置
*/
@@ -23,7 +23,6 @@ export class SysSettingsService extends BaseService<SysSettingsEntity> {
getRepository() {
return this.repository;
}
async getById(id: any): Promise<SysSettingsEntity | null> {
const entity = await this.info(id);
if (!entity) {
@@ -129,10 +128,12 @@ export class SysSettingsService extends BaseService<SysSettingsEntity> {
async reloadPrivateSettings() {
const bean = await this.getPrivateSettings();
if (bean.httpProxy || bean.httpsProxy) {
setGlobalProxy({
const opts = {
httpProxy: bean.httpProxy,
httpsProxy: bean.httpsProxy,
});
};
setGlobalProxy(opts);
agents.setGlobalProxy(opts);
}
}