Skip to content

Commit

Permalink
fix: 处理不同系统打包问题
Browse files Browse the repository at this point in the history
  • Loading branch information
fangcy committed Nov 8, 2023
1 parent 8069e2f commit 7f92a4e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src-tauri/src/data/data_source_con.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,12 @@ pub mod cmd {
proxy_server::init_proxy_server();
}
app_conf.write();
if cfg!(target_os = "windows") {
reg_util::set_windows_proxy(enable, proxy_ip1);
} else if cfg!(target_os = "linux") {
bashrc_util::set_proxy(enable, proxy_ip1);
} else if cfg!(target_os = "macos") {
mac_util::set_windows_proxy(enable, proxy_ip1);
}
#[cfg(target_os = "windows")]
reg_util::set_windows_proxy(enable, proxy_ip1);
#[cfg(target_os = "linux")]
bashrc_util::set_proxy(enable, proxy_ip1);
#[cfg(target_os = "macos")]
mac_util::set_windows_proxy(enable, proxy_ip1);
}
}

1 change: 1 addition & 0 deletions src-tauri/src/internet/reg_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const KEY_PROXY_SERVER: &str = "ProxyServer";
// const KEY_PROXY_OVERRIDE: &str = "ProxyOverride";

// 将 &str 类型转为 LPCWSTR 类型
#[cfg(target_os = "windows")]
fn str_to_lpcwstr(str: &str) -> Vec<u16> {
OsStr::new(str).encode_wide().chain(once(0)).collect()
}
Expand Down

0 comments on commit 7f92a4e

Please sign in to comment.