fix: faile to reset sysproxy (#5139)

This commit is contained in:
oomeow
2025-10-20 23:09:13 +08:00
committed by GitHub
parent 91e12798e4
commit a5c00ecb12

View File

@@ -201,15 +201,18 @@ impl Sysopt {
//直接关闭所有代理 //直接关闭所有代理
#[cfg(not(target_os = "windows"))] #[cfg(not(target_os = "windows"))]
{ {
let mut sysproxy: Sysproxy = Sysproxy::get_system_proxy()?; let mut sysproxy: Sysproxy = match Sysproxy::get_system_proxy() {
Ok(sp) => sp,
Err(e) => {
log::warn!(target: "app", "重置代理时获取系统代理配置失败: {e}, 使用默认配置");
Sysproxy::default()
}
};
let mut autoproxy = match Autoproxy::get_auto_proxy() { let mut autoproxy = match Autoproxy::get_auto_proxy() {
Ok(ap) => ap, Ok(ap) => ap,
Err(e) => { Err(e) => {
log::warn!(target: "app", "重置代理时获取自动代理配置失败: {e}, 使用默认配置"); log::warn!(target: "app", "重置代理时获取自动代理配置失败: {e}, 使用默认配置");
Autoproxy { Autoproxy::default()
enable: false,
url: "".into(),
}
} }
}; };
sysproxy.enable = false; sysproxy.enable = false;