This commit is contained in:
Tw93
2022-12-07 22:48:41 +08:00
3 changed files with 1970 additions and 1961 deletions

View File

@@ -195,8 +195,17 @@ fn main() -> wry::Result<()> {
.build()?;
// 自定义cookie文件夹仅用于Linux
// Custom Cookie folder, only for Linux
// #[cfg(target_os = "linux")]
// let config_path = format!("/home/{}/.config/{}", env!("USER"), package_name);
#[cfg(target_os = "linux")]
let config_path = format!("/home/{}/.config/{}", env!("USER"), package_name);
let user = std::env::var_os("USER");
#[cfg(target_os = "linux")]
let config_path = match user {
Some(v) => format!(
"/home/{}/.config/{}", v.into_string().unwrap(), package_name
),
None => panic!("can't found any user")
};
#[cfg(target_os = "linux")]
let data_path = std::path::PathBuf::from(&config_path);
#[cfg(target_os = "linux")]